import java.util.*; //Date
: y0 G4 E0 y* Uimport java.text.*; //SimpleDateFormat
: z3 Y% D: @& h$ m# R$ Z1 g
* }. e+ b Z$ w! N7 {) m6 Z5 ]public class j102{
( {5 f W' y, D2 `& }6 K, m
: u; X, a& c8 \ public static void main(String arg[]){
! j. Y! Q4 }( Z/ l, \, C! N: X7 B System.out.println("------------------");
7 j& Y; E* l7 [: b( W System.out.println(" 當地時間拉 ");
0 G2 H9 V7 U/ g3 R! S. x* w0 K: i6 ]* _ System.out.println("------------------");
/ V5 Z) X3 f6 [# S8 i* D Date d = Calendar.getInstance().getTime();; d$ Z- D" }1 g i6 D
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/M/d a hh:mm");
) _! `2 ~* Y2 O0 [* k5 D SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy/M/d a hh:mm:ss");+ B, q1 W1 _: |
SimpleDateFormat sdf3 = new SimpleDateFormat("yyyy年M月d日 ahh時mm分ss秒");
( j! ]) M0 H2 \/ ^( W" e* Z SimpleDateFormat sdf4 = new SimpleDateFormat("yyyy年M月d日 E ahh時mm分ss秒 z");. c+ x4 E( N/ m7 e3 E
System.out.println(sdf1.format(d));" G& ?6 x D+ |& L/ E: h
System.out.println(sdf2.format(d));7 u: ?9 J( c( _2 C
System.out.println(sdf3.format(d));7 e: u; H; {) V) x7 x
System.out.println(sdf4.format(d));- S3 y) Q+ |: F1 a! \2 X
}: ^: i. S$ Y$ }5 P/ Y- Y9 M. i
} |