Java FileTime create from days

Introduction

TimeUnit is an enumeration found in the java.util.concurrent package.

It represents a time duration as defined in the following table.

Enumeration Value Meaning
NANOSECONDS One thousandth of a microsecond
MICROSECONDSOne thousandth of a millisecond
MILLISECONDSOne thousandth of a second
SECONDS A second
MINUTES Sixty seconds
HOURS Sixty minutes
DAYSTwenty four hours
import java.nio.file.attribute.FileTime;
import java.util.concurrent.TimeUnit;

public class Main {

   public static void main(String[] args) {

      FileTime fileTime = FileTime.from(1000, TimeUnit.DAYS);
      System.out.println(fileTime);

   }/*from  w  ww  .  ja va  2s  .co m*/

}



PreviousNext

Related