Java中將毫秒數改爲相應的年月日格式

time = file.lastModified();//獲取文件的最後修改時間,格式爲毫秒數 Date date = new Date(time); SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd"); System.out.println(sdf.format(date));
相關文章
相關標籤/搜索