import java.util.*; //Date" D* [' {6 i7 T6 |0 A; l$ t
import java.text.*; //SimpleDateFormat$ Q, x3 E8 t4 E) y$ C
. J6 R8 r+ L: X, G+ O
public class j102{1 s k+ W1 Z6 h# U& ~
: L; r/ v+ n7 w) q) B public static void main(String arg[]){
! P/ O2 ` e. ~9 W# f. L- C9 N3 i1 l System.out.println("------------------");7 {- ^: R( f0 r) m* h6 H0 N
System.out.println(" 當地時間 ");
& t: a4 a4 Q! U/ t1 v& q System.out.println("------------------");! a r$ A! Z/ Q+ x
Date d = Calendar.getInstance().getTime();6 X% t' e7 {, b
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/M/d a hh:mm");
& |7 p' V4 Y- |# J5 u SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy/M/d a hh:mm:ss");, ` q7 ~/ k8 ]. ?/ c& o5 L
SimpleDateFormat sdf3 = new SimpleDateFormat("yyyy年M月d日 ahh時mm分ss秒");) c) k; u2 d' t) U
SimpleDateFormat sdf4 = new SimpleDateFormat("yyyy年M月d日 E ahh時mm分ss秒 z");, H! @- C1 V I( q/ b0 n
System.out.println(sdf1.format(d));+ J8 x4 Z& R* U3 u5 ~5 K
System.out.println(sdf2.format(d));4 L2 ^) o+ ?, x; O6 {2 ~% h: I, C4 E
System.out.println(sdf3.format(d));
1 K1 j# ]$ A& m! }6 [% y System.out.println(sdf4.format(d));! G2 U8 s& h! o6 q! F
}
/ \! u0 N8 v- f7 G* ~+ n I} |