import java.util.*; //Date
) C- z; m: F2 Q6 {. iimport java.text.*; //SimpleDateFormat
7 t( J, a8 K4 Z- U
3 u* \' T( g1 d8 b5 z; w" wpublic class j102{) V3 v$ t% T% m' L: x& j
$ ?; D, u* {9 ^% Z- @7 F public static void main(String arg[]){' H9 N) F* V* I1 k% a8 z
System.out.println("------------------");
, u+ S5 n8 S( a. c9 d% r. R3 q1 r System.out.println(" 當地時間 ");
5 N3 a, _ W2 b# W- l System.out.println("------------------");, `2 a7 r4 l1 v: M( c2 e% Q" @
Date d = Calendar.getInstance().getTime();- G4 \ `/ Z9 u0 Q, O
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/M/d a hh:mm");
9 d' \3 [0 G" a' | SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy/M/d a hh:mm:ss"); z" M1 ?1 t& o) H3 s$ F% Q
SimpleDateFormat sdf3 = new SimpleDateFormat("yyyy年M月d日 ahh時mm分ss秒");2 i" T) R: F: A, E$ C N
SimpleDateFormat sdf4 = new SimpleDateFormat("yyyy年M月d日 E ahh時mm分ss秒 z");; v8 f! k' b, [7 [
System.out.println(sdf1.format(d));* S# m5 N" u8 i0 T1 f
System.out.println(sdf2.format(d));3 O7 S) G- S t y
System.out.println(sdf3.format(d));
9 ]) j6 S' n# C C8 x3 X System.out.println(sdf4.format(d));/ x6 t; o7 I7 p4 F1 v7 J: ]1 b
}6 ~* U" T* T2 ]/ E6 a
} |