Java FileTime.toString()

Syntax

FileTime.toString() has the following syntax.

public String toString()

Example

In the following code shows how to use FileTime.toString() method.


import java.nio.file.attribute.FileTime;
//w  ww . j  a  v  a 2 s.  co m
public class Main {

  public static void main(String[] args) throws Exception {

    long time = System.currentTimeMillis();
    FileTime fileTime = FileTime.fromMillis(time);
        System.out.println(fileTime.toString());

  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.nio.file.attribute »




BasicFileAttributes
BasicFileAttributeView
DosFileAttributes
FileTime
PosixFileAttributes
PosixFilePermissions