import java.util.*; //Date5 H' B& e5 O/ }& g7 i: m* D' }
import java.text.*; //SimpleDateFormat. e N+ o, S0 E
5 w z6 l9 \ l. s- bpublic class j102{
* {; y, l, {/ F& a) r s; u% Z# z3 E4 m3 B, t- ^+ d$ o
public static void main(String arg[]){4 M2 p* x4 T2 b- \6 \+ j
System.out.println("------------------");4 k+ T6 r# R% Z, {! R" x/ Z' v W
System.out.println(" 當地時間拉 ");
$ w& R: N7 c }# ?* w System.out.println("------------------");3 N. s( ?% k- E( S9 N' z' U
Date d = Calendar.getInstance().getTime();) @8 p8 g/ G4 a+ g0 T4 X$ p
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/M/d a hh:mm");" d: r4 i# V* S& F/ e+ v' C: f
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy/M/d a hh:mm:ss");
5 E0 d- W2 r; u" i! E' ? SimpleDateFormat sdf3 = new SimpleDateFormat("yyyy年M月d日 ahh時mm分ss秒");
5 r6 o& D9 F' ?0 L- K8 c SimpleDateFormat sdf4 = new SimpleDateFormat("yyyy年M月d日 E ahh時mm分ss秒 z");; g0 d u8 W& M! r0 j" H/ J" n6 ]
System.out.println(sdf1.format(d));6 ]/ J/ L' y5 E5 f7 g3 x4 a
System.out.println(sdf2.format(d));
5 K7 p9 a/ r0 o/ _' A System.out.println(sdf3.format(d));
1 C) Z& ~ ]' i- f2 x" @ System.out.println(sdf4.format(d));
, V$ [1 O1 d0 E! u F }7 P6 V9 u$ O/ m1 y% h! @
} |