I am trying to get the number of days, after the last modification of a given file.
Following code gives me 18135
when checked for a file which is just been modified.
Code
public class IOExamples {
public static void main(String[] args) throws IOException {
Path path = Paths.get("zoo.log"); // zoo.log was just been modified
System.out.println(Files.getLastModifiedTime(path).to(TimeUnit.DAYS));
}
}
The output is just a number -
Output
18135
Please help me get the number of days.