次のコードのファイルの日付が変更されないのはなぜですか?
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)));
出力:
Changed: false
Fri Feb 15 23:02:51 CET 2013
Fri Feb 15 22:49:34 CET 2013