Answers for "How to know the creation date of a file java"

1

java get creation date of file

Path file = ...;
BasicFileAttributes attr = Files.readAttributes(file, BasicFileAttributes.class);

System.out.println("creationTime: " + attr.creationTime());
System.out.println("lastAccessTime: " + attr.lastAccessTime());
System.out.println("lastModifiedTime: " + attr.lastModifiedTime());
Posted by: Guest on August-16-2020

Code answers related to "How to know the creation date of a file java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language