import java.util.*; //Date: E; \& U; b! F" A3 X; z2 m. b
import java.text.*; //SimpleDateFormat3 K, H2 k( Y0 n# o6 u/ \; K
2 F0 I- Y0 \7 R- O9 `: K* lpublic class j102{# {3 f4 m+ v6 r7 O7 o: p* i
5 |4 M- h7 e% k( }
public static void main(String arg[]){, F+ @) @% _6 U9 Q, m: i* ~
System.out.println("------------------");
7 `! x8 E- e) J& l System.out.println(" 當地時間拉 ");
+ R; b# o }4 e% ~3 o System.out.println("------------------");% A, X3 h2 W$ L$ O; }/ Y" C
Date d = Calendar.getInstance().getTime();
6 V+ z' _" H- K8 q SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/M/d a hh:mm");) ?+ [. a7 [: e; l
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy/M/d a hh:mm:ss");
+ ^9 p; \- r+ H# `) O. Q7 e5 W SimpleDateFormat sdf3 = new SimpleDateFormat("yyyy年M月d日 ahh時mm分ss秒");( e5 ?! T9 U' m- T: @
SimpleDateFormat sdf4 = new SimpleDateFormat("yyyy年M月d日 E ahh時mm分ss秒 z");
$ S% a- o! |) I1 `: X System.out.println(sdf1.format(d));3 s g0 |5 w) s2 U" y$ g! C9 t, L
System.out.println(sdf2.format(d));* d! j0 O+ e0 n
System.out.println(sdf3.format(d));
/ {5 A8 t2 t, l0 [ System.out.println(sdf4.format(d));% x5 P3 d" G z$ O1 w6 ^+ n
}( {* a; D1 J+ R8 }
} |