import java.util.*; //Date
. {$ M0 U* P6 C9 A! B0 j! Rimport java.text.*; //SimpleDateFormat
1 ^( C( N( X( @/ l1 k, f6 e c2 `. b& R: ^. y
public class j102{
( n7 S4 F0 O, k0 v
0 P, G: t o1 y. l" Z! x1 M public static void main(String arg[]){0 }3 {0 x) C/ x8 p0 Q' K: H# a
System.out.println("------------------");6 ^. S( f0 m/ X" g6 |+ L
System.out.println(" 當地時間拉 ");* @6 Z1 A& A3 R1 X5 Y3 m6 r$ b
System.out.println("------------------");
; A4 T8 k( m2 C1 N n Date d = Calendar.getInstance().getTime();
3 Y' _# }+ d" }9 h& Y SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/M/d a hh:mm");" ]+ v7 P* l- m1 f5 V3 p- p! B
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy/M/d a hh:mm:ss");7 B5 N* B. q, [/ Q
SimpleDateFormat sdf3 = new SimpleDateFormat("yyyy年M月d日 ahh時mm分ss秒");! K4 m6 J; M' \, g
SimpleDateFormat sdf4 = new SimpleDateFormat("yyyy年M月d日 E ahh時mm分ss秒 z");' T+ ~, j% Q, U6 V9 m1 U
System.out.println(sdf1.format(d));! ~, J* k5 J P5 W1 S% F$ p7 o+ D* s
System.out.println(sdf2.format(d));
: }( W, o* T) Y/ b- ?( l* R. b System.out.println(sdf3.format(d));
3 L+ M* \# _ D1 q$ m System.out.println(sdf4.format(d));- b2 [4 Z+ h! }1 I4 J, F4 Q
}
4 u. S0 J. @. X' Y% _) z# c} |