If you want to know last modified date for file in java, run this code:


File myFile = new File("c:\\myFile.txt");

System.out.println(myFile.lastModified());

SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");

System.out.println(simpleDateFormat.format(myFile.lastModified()));