import java.util.*; //Date, }2 [2 [2 M' O5 [; f2 N
import java.text.*; //SimpleDateFormat- Q' b9 ^3 B+ M' a
9 ?/ P g2 F' M$ D- ppublic class j102{
2 c1 d/ ^# f+ T! G1 N4 h" L8 F
2 w9 @' [; G+ Z% b& l public static void main(String arg[]){
7 f" ^8 ]" D# q" P$ k- b System.out.println("------------------");
* { i: f' j4 p- u System.out.println(" 當地時間 ");! i( r! y( ?" D, L3 n: s
System.out.println("------------------"); L- ]9 B& ^% b8 [
Date d = Calendar.getInstance().getTime();
8 u9 m, T! g# x& ^+ q$ X2 r) k SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/M/d a hh:mm");" k+ |) X: [' D/ D3 s( R
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy/M/d a hh:mm:ss");, c1 I; c& V- R3 O- N: p
SimpleDateFormat sdf3 = new SimpleDateFormat("yyyy年M月d日 ahh時mm分ss秒");% v Q ~. t5 L- R C1 B# @0 x8 F5 @
SimpleDateFormat sdf4 = new SimpleDateFormat("yyyy年M月d日 E ahh時mm分ss秒 z");2 m% p c! v! ?3 [: T
System.out.println(sdf1.format(d));
`( j. N- B" N System.out.println(sdf2.format(d));
: V3 R, d. ~3 v9 | System.out.println(sdf3.format(d));
# A8 x* p$ X2 b4 n6 n6 w1 Q System.out.println(sdf4.format(d));. l) \7 B5 U& @, q+ a
}
" ^1 l& D% t# _2 P& a2 _. L} |