java.util.Date用法

 //獲取當前時間

 Date curdate = new Date(System.currentTimeMillis());

 

//日期數據定製格式

SimpleDateFormat bartDateFormat = new SimpleDateFormat("EEEE-MMMM-dd-yyyy");
Date date = new Date();
System.out.println(bartDateFormat.format(date));

“星期幾-月-日-年”輸出:“Sat-09-29-01”

 

 

   

發佈了22 篇原創文章 · 獲贊 1 · 訪問量 2萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章