Java Date(long date) Constructor

Syntax

Date(long date) constructor from Date has the following syntax.

public Date(long date)

Example

In the following code shows how to use Date.Date(long date) constructor.

It creates java Date from specific time.


import java.util.Date;
/*from  w  w  w .  ja va  2s .  co m*/
import java.util.Date;

public class Main {
  public static void main(String[] args) {
    Date d = new Date(365L * 24L * 60L * 60L * 1000L+99999999L);
    System.out.println(d);
  }
}

The output: