import java.util.*; //Date
0 i6 V+ ^ N* W# P- s8 Kimport java.text.*; //SimpleDateFormat0 ]: E1 H) ?6 Z0 g- _
3 R$ n; g1 J+ c- @
public class j102{
5 g* L+ f/ i' @% o1 u5 q" K$ w( k: q% ~. n( O1 D
public static void main(String arg[]){: s/ }$ z% H8 C! Y n2 ^+ y. m
System.out.println("------------------");2 |; B* ]/ h5 |; E" t2 k! x9 ~" V7 l
System.out.println(" 當地時間 ");
! v, U, ^. e2 B8 y6 n% _, g- x System.out.println("------------------");
5 q* {2 R+ D' T( o. V6 [ Date d = Calendar.getInstance().getTime();
/ F. ]4 F& p2 Z SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/M/d a hh:mm");
! W) g2 I, |3 n' U SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy/M/d a hh:mm:ss");# [* b& J1 Z& h) I& p# v9 G& I' f4 g
SimpleDateFormat sdf3 = new SimpleDateFormat("yyyy年M月d日 ahh時mm分ss秒");
/ U$ r+ s7 T. F" B SimpleDateFormat sdf4 = new SimpleDateFormat("yyyy年M月d日 E ahh時mm分ss秒 z");( B9 V7 ^/ \% J
System.out.println(sdf1.format(d));3 q1 P7 z0 F N% p2 b2 g7 k
System.out.println(sdf2.format(d));! X# }/ Z6 r& K. m" i2 S
System.out.println(sdf3.format(d));( h M; Y7 z7 L
System.out.println(sdf4.format(d));8 h% ^1 [0 a' R; ?! K- Q! U# t
}
, v7 M& v: N5 M} |