Answers for "how do i get the date from a file that just got created to a java file"

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 do i get the date from a file that just got created to a java file"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language