import java.util.*; //Date
! a6 M# n9 R# b/ z& ?; rimport java.text.*; //SimpleDateFormat
! w% Z$ W& O) ^+ M; @. q- w% D
public class j102{
/ |; L6 v0 O* i) l; b1 z2 }* ?
% |. H9 s# D% d" M6 h$ u$ a; A* O6 Q public static void main(String arg[]){
( W" [/ D& N4 G) ^. h: t& T) x System.out.println("------------------");
( {7 k6 R) p+ `0 I, g# N! @ System.out.println(" 當地時間拉 ");8 v( k7 @, `0 K' m, u2 ?- M- R! L7 ?+ h
System.out.println("------------------"); d0 [9 A7 V L g$ s* i; S
Date d = Calendar.getInstance().getTime();
: `: x6 V5 O4 e4 O8 r3 a SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/M/d a hh:mm");$ d" V) _# T; H- U# D
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy/M/d a hh:mm:ss");2 T/ a# A6 \, Z9 r7 j5 z2 I5 e
SimpleDateFormat sdf3 = new SimpleDateFormat("yyyy年M月d日 ahh時mm分ss秒");
' u ^) E0 m2 e/ L, h SimpleDateFormat sdf4 = new SimpleDateFormat("yyyy年M月d日 E ahh時mm分ss秒 z");. ^+ M, z; ^) ~8 w% C' G
System.out.println(sdf1.format(d));2 o/ l0 t4 x, h0 r
System.out.println(sdf2.format(d));$ B7 E1 u- ?. i$ R* \$ f7 E7 l% j
System.out.println(sdf3.format(d));. Z" E4 k9 m0 v) C8 H
System.out.println(sdf4.format(d));1 n; q/ y" F8 K% ^" [$ d; ~
}( q% S* v: j. x0 v( X3 k/ p6 W0 D
} |