Create java Date from specific time - Java Date Time

Java examples for Date Time:Legacy Date

Description

Create java Date from specific time

Demo Code

import java.util.Date;
 
public class Main {
 
  public static void main(String[] args) {
   /*ww  w  .  j a  v a2s. c om*/
    //date after one year of January 1, 1970, 00:00:00 GMT
    Date d = new Date(365L * 24L * 60L * 60L * 1000L);
    System.out.println(d);
  }
}

Result


Related Tutorials