import java.util.*; //Date
+ G9 Z- h9 G4 t k( Kimport java.text.*; //SimpleDateFormat
0 c, g3 u1 q) r( Y" e- n: W5 n7 a: g" j; Z& T+ I6 q
public class j102{# L" M; y( p+ G6 F% |! I# l! T- E
1 _& x6 F C+ h: t6 {! o# C( w public static void main(String arg[]){" A g! [2 c+ c/ w D0 s& G- P1 ~
System.out.println("------------------");/ V3 J+ f% L( p, l
System.out.println(" 當地時間 ");, V& |6 u* C2 c+ z( b9 v9 i
System.out.println("------------------");
! ^$ _0 h E0 Z# h' T$ a: w Date d = Calendar.getInstance().getTime();
! }& D" x$ ~, {9 k/ z9 t8 q SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/M/d a hh:mm");0 O5 ^' K8 U/ _8 I+ S
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy/M/d a hh:mm:ss");& `+ Y8 b2 W, {( R5 h) j
SimpleDateFormat sdf3 = new SimpleDateFormat("yyyy年M月d日 ahh時mm分ss秒"); N5 t# N# J$ r2 s4 P* a" Z) P; \
SimpleDateFormat sdf4 = new SimpleDateFormat("yyyy年M月d日 E ahh時mm分ss秒 z");* y& A) ?% U) r- b7 S7 H8 n
System.out.println(sdf1.format(d));
9 {! O8 H9 ^8 S( n& c2 h System.out.println(sdf2.format(d));$ s! f2 V; ^7 D( v6 h0 N
System.out.println(sdf3.format(d));
) N) I4 e' a, c# G System.out.println(sdf4.format(d));
: x. Y' \5 W: K9 `+ f }
2 W) ?: j1 H- G2 k) r, ^- J4 u, f% |0 V} |