首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

读取资料的最后修改时间的方法

2012-09-12 
读取文件的最后修改时间的方法/** * 读取文件的最后修改时间的方法 */private static String getFileLastM

读取文件的最后修改时间的方法

/** * 读取文件的最后修改时间的方法 */private static String getFileLastModifiedTime(String filePath) {String path = filePath.toString();File f = new File(path);Calendar cal = Calendar.getInstance();long time = f.lastModified(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); cal.setTimeInMillis(time);// 输出:修改时间[2] 2009-08-17 10:32:38return formatter.format(cal.getTime());}
?

?

热点排行