import java.util.*; //Date
; S8 E! G M7 n: L/ Z; Q# C7 Rimport java.text.*; //SimpleDateFormat6 O) g! X4 M* H. B
, _* n2 u; x1 F) P4 S2 L
public class j102{
0 a, ]% z9 V5 B) \ }3 c# X
T$ x9 l& L! ] public static void main(String arg[]){
2 K" M8 f/ H# r6 Y/ ~# @. d$ S System.out.println("------------------");7 U; h2 I, F5 i. n5 e9 g- z' j
System.out.println(" 當地時間 ");
- M- @. ?3 h/ R# ~ System.out.println("------------------");% t- o. m, n$ R2 L; r* {4 V
Date d = Calendar.getInstance().getTime(); }& B% {3 \. s6 S
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/M/d a hh:mm");; c" U4 L+ w0 D& v* U% B4 c
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy/M/d a hh:mm:ss");4 e, C& S. o4 v
SimpleDateFormat sdf3 = new SimpleDateFormat("yyyy年M月d日 ahh時mm分ss秒");* W4 W5 U$ C1 ~5 f) u7 i1 L
SimpleDateFormat sdf4 = new SimpleDateFormat("yyyy年M月d日 E ahh時mm分ss秒 z");$ T, p z( i2 M6 G
System.out.println(sdf1.format(d));' q W! E* n& a* Y) |0 _4 L
System.out.println(sdf2.format(d));4 h/ T$ K2 F c: X5 @
System.out.println(sdf3.format(d));
" R; G9 t$ y; W/ T3 z' f) f4 }% e- B System.out.println(sdf4.format(d));6 J- B* `( C2 B+ z9 r
}
5 t: N' U9 E/ ]. z% x' }} |