import java.util.*; //Date
2 L5 i# o, m* r5 x; S4 }, m) jimport java.text.*; //SimpleDateFormat# {$ L+ ]5 s9 p' r9 n
" ]4 | l: y- ?6 B
public class j102{9 k$ p+ I: P" R/ {1 b Q1 d
% V- ?% q% n1 B# z. v public static void main(String arg[]){
4 `/ j0 ?' `3 r+ g System.out.println("------------------");1 m9 w ]: n% k
System.out.println(" 當地時間 ");4 v, ]* u( O% A1 d* ]/ ~$ s
System.out.println("------------------");0 B# A6 l$ `0 ^; H' @" }4 o
Date d = Calendar.getInstance().getTime();
' E( {8 F# f8 p6 p0 f* n SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/M/d a hh:mm");
5 @7 O2 g' s# K5 ~. E4 K SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy/M/d a hh:mm:ss");1 d' O, }, ]. z6 V
SimpleDateFormat sdf3 = new SimpleDateFormat("yyyy年M月d日 ahh時mm分ss秒");6 D4 A( p o$ J" W$ Q( K
SimpleDateFormat sdf4 = new SimpleDateFormat("yyyy年M月d日 E ahh時mm分ss秒 z");
) E. z# B3 }* X" R( T0 ]2 n7 A! q) H System.out.println(sdf1.format(d));
0 ~$ E. q' A4 u' }, G System.out.println(sdf2.format(d));( Z4 ^# D) N7 c* z
System.out.println(sdf3.format(d));
% y6 z9 N0 Q" |5 } N System.out.println(sdf4.format(d));
7 t- `2 [6 M' F" E" c4 Q }2 o+ Z( Q2 v0 e/ Y2 w
} |