import java.util.*; //Date
; J. s) O$ ?4 H1 ^+ kimport java.text.*; //SimpleDateFormat$ [, s8 U3 o$ p! ^* a: q
1 q2 Q" H/ c2 D% w. X' R& Mpublic class j102{2 W7 P' X8 w/ O, a' f5 P2 Q {
1 ?# k. p, o% G7 O+ ` public static void main(String arg[]){5 _, A1 g3 B5 ?/ x4 \
System.out.println("------------------");
( D7 y; N# R- U. G0 B& \' u( Y System.out.println(" 當地時間 ");
0 @3 @1 B' F( { System.out.println("------------------"); k7 `4 X9 S! J2 z- Y
Date d = Calendar.getInstance().getTime();: i! C4 L; W: t) b$ ^
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/M/d a hh:mm");
- l( i3 a; O: @; {* Z2 V SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy/M/d a hh:mm:ss");
! s o, H. ]" Z! J7 s4 s& } SimpleDateFormat sdf3 = new SimpleDateFormat("yyyy年M月d日 ahh時mm分ss秒");5 l7 m; F, Y" e) T) R/ s
SimpleDateFormat sdf4 = new SimpleDateFormat("yyyy年M月d日 E ahh時mm分ss秒 z");
/ }; }: g) D3 s. P System.out.println(sdf1.format(d));2 \1 g q7 r% ^, \% K# O
System.out.println(sdf2.format(d));
( S5 \5 M$ o+ e- C" A5 x System.out.println(sdf3.format(d));! l W# _( ~7 w& E3 x- p' E: J
System.out.println(sdf4.format(d));# U' v# J8 U: `& a1 O$ u
}
' e( E2 d8 m1 t} |