- package bbs.istak.org.tw;
- import java.text.SimpleDateFormat;
- import java.util.Date;
- public class Main {
- public static void main(String[] args) {
- // TODO 自動產生的方法 Stub
- Date date = new Date();
- SimpleDateFormat sdf0 = new SimpleDateFormat("yyyy/MM/dd aH:mm");
- SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/MM/dd aH:mm:ss");
- SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy年MM月dd日 aH時mm分ss秒");
- SimpleDateFormat sdf3 = new SimpleDateFormat("yyyy年MM月dd日 E aH時mm分ss秒");
-
- System.out.println(sdf0.format(date));
- System.out.println(sdf1.format(date));
- System.out.println(sdf2.format(date));
- System.out.println(sdf3.format(date));
-
- }
- }
複製代碼 |