Java Instant create seconds from Epoch

Description

Java Instant create seconds from Epoch

import java.time.Instant;

public class Main {
  public static void main(String[] args) {
    Instant i1 = Instant.ofEpochSecond(20);
    Instant i2 = Instant.ofEpochSecond(55);
    System.out.println("i1:" + i1);
    System.out.println("i2:" + i2);


  }/*from w w  w .ja  v  a2  s. c o  m*/
}



PreviousNext

Related