Java tutorial
import java.io.File; import java.util.Date; public class Main { public static void main(String[] args) { File f = new File("C:/test.txt"); long millisec = new Date().getTime(); // set last modified time boolean bool = f.setLastModified(millisec); System.out.println("lastModified() succeeded?: " + bool); } }