Java Date Time - 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  ww w .j a va2s . c o  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: