为什么以下代码中的文件日期没有更改?
fLocal.location = C:\中的现有文件
fLocal.date =在Long中设置的日期
boolean x = new File(fLocal.location).setLastModified(Long.parseLong(fLocal.date));
System.out.println("Changed: " + x);
System.out.println(new Date(new File(fLocal.location).lastModified()));
System.out.println(new Date(Long.parseLong(fLocal.date)));
Run Code Online (Sandbox Code Playgroud)
输出:
Changed: false
Fri Feb 15 23:02:51 CET 2013
Fri Feb 15 22:49:34 CET 2013
Run Code Online (Sandbox Code Playgroud)