package util;
import java.util.Calendar;
import java.util.TimeZone;
class Calendar01 {
public static void main(String[] args) {
Calendar cal = Calendar.getInstance();
print(cal.toString());
print(cal);
print("--");
TimeZone tz = TimeZone.getTimeZone("Asia/Tokyo");
cal = Calendar.getInstance(tz);
print(cal.toString());
print(cal);
print("--");
tz = TimeZone.getTimeZone("Europe/London");
cal = Calendar.getInstance(tz);
print(cal.toString());
print(cal);
}
public static void print(Calendar cal) {
print(cal.get(Calendar.YEAR)+"年"
+(cal.get(Calendar.MONTH)+1)+"月"
+cal.get(Calendar.DAY_OF_MONTH)+"日 "
+cal.get(Calendar.HOUR_OF_DAY)+"時"
+cal.get(Calendar.MINUTE)+"分"
+cal.get(Calendar.SECOND)+"秒");
}
private static void print(String s) {
System.out.println(s);
}
}
==
・目次 Java Stringとjava.util
http://blogs.yahoo.co.jp/artery2020/39979089.html
・目次 - Java言語プログラミング入門
http://blogs.yahoo.co.jp/artery2020/39975776.html
・目次 - ビジネスパーソンの常識と非常識
http://blogs.yahoo.co.jp/artery2020/39728331.html
・目次 - 論理・発想・思考についての考察と鍛え方
http://blogs.yahoo.co.jp/artery2020/39657784.html
== ended.