格式化System.currentTimeMillis()
?1?import?java.text.SimpleDateFormat;
?2?import?java.util.Locale;
?3?
?4?
?5?public?class?FormatCurrentTime?{
?6?????/**
?7??????*?@param?args
?8??????*/
?9?????public?static?void?main(String[]?args)?{
10?????????
11?????????SimpleDateFormat?sdf?=?new?SimpleDateFormat("",?Locale.SIMPLIFIED_CHINESE);
12?????????sdf.applyPattern("yyyy年MM月dd日?HH時mm分ss秒");
13?????????System.out.println(sdf.format(System.currentTimeMillis()));
14?????????
15?????}
16?}
17?
?2?import?java.util.Locale;
?3?
?4?
?5?public?class?FormatCurrentTime?{
?6?????/**
?7??????*?@param?args
?8??????*/
?9?????public?static?void?main(String[]?args)?{
10?????????
11?????????SimpleDateFormat?sdf?=?new?SimpleDateFormat("",?Locale.SIMPLIFIED_CHINESE);
12?????????sdf.applyPattern("yyyy年MM月dd日?HH時mm分ss秒");
13?????????System.out.println(sdf.format(System.currentTimeMillis()));
14?????????
15?????}
16?}
17?
posted on 2007-01-12 14:57 liaojiyong 閱讀(834) 評論(0) 編輯 收藏 所屬分類: Java