Answers for "get created at 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 "get created at file java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language