import java.io.File;
import java.io.IOException;
import java.util.Date;
public class FileChange {
public static void main(String[] args) throws IOException {
File file = new File("copyfile");
file.createNewFile();
Date fileTime = new Date(file.lastModified()); //获取最后修改时间
System.out.println(fileTime.toString());
System.out.println(file.setLastModified(System.currentTimeMillis()));
fileTime= new Date(file.lastModified());
System.out.println(fileTime.toString());
}
}