Java FileTime create from Instant

Description

Java FileTime create from Instant

import java.nio.file.attribute.FileTime;
import java.time.Instant;

public class Main {
  public static void main(String[] args) {
     Instant ins = Instant.now();
     System.out.println("ins:"+ins);

     FileTime fileTime = FileTime.from(ins);
     System.out.println(fileTime);
  }/*  w  w w . java 2s  .  co m*/
}



PreviousNext

Related