import java.util.*; //Date4 [; x- [+ m U' \& x7 F1 {
import java.text.*; //SimpleDateFormat
7 z( }( `3 _9 `( }% x* t& t
( f* e! ^6 L; \' tpublic class j102{
: ^# G. G# X, _
7 v& t, K5 _! D6 s public static void main(String arg[]){
5 E8 r0 `) ` R! d9 y2 ?, [# ]4 g$ i System.out.println("------------------");" N4 k# l7 n9 t4 N ~+ Y# f
System.out.println(" 當地時間 ");
3 @3 Z j1 ~/ c. x# I! c+ q System.out.println("------------------");
- e. B+ h: c' s Date d = Calendar.getInstance().getTime();4 L5 \* t* z; |9 t+ u& b
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/M/d a hh:mm");
* {2 k- z% G* a: ~0 h SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy/M/d a hh:mm:ss");% `" E; f: o9 Y3 a8 D! j- y6 I
SimpleDateFormat sdf3 = new SimpleDateFormat("yyyy年M月d日 ahh時mm分ss秒");
* B9 v2 F# r) ]3 [9 `# Y; r* E: o SimpleDateFormat sdf4 = new SimpleDateFormat("yyyy年M月d日 E ahh時mm分ss秒 z");
* F4 J- s$ | B# f, ^* {4 k+ h! r System.out.println(sdf1.format(d));5 s4 r8 ^3 V; @- W
System.out.println(sdf2.format(d));
$ y$ I; t( {% n( |1 L3 u( J System.out.println(sdf3.format(d));
* F4 R; J2 X0 v& |( M# C0 R( s8 J, @ System.out.println(sdf4.format(d));: u; @- W |: \8 i: ]) P
}
# ~4 q* k6 c* D7 [' {0 `} |