I do not need the time of the last modification, not the time of the last access to the file, but the time of creating the file. I did not find information about this. Maybe some libraries?
Path p = Paths.get(f.getAbsoluteFile().toURI()); BasicFileAttributes view = null; try { view = Files.getFileAttributeView(p, BasicFileAttributeView.class).readAttributes(); } catch (IOException e) {
In this code, the creation time is invalid and returns today's date.
Operating System: Windows 7 Java: SE-1.7
java file
Ihor kostenko
source share