Write a Java Program to Get a date from milliseconds using Date() constructor


This code creates a Date object with the specified number of milliseconds since the epoch (January 1, 1970, 00:00:00 GMT) using the Date constructor that takes a long value as an argument. The Date object is then printed to the console using System.out.println(). The output will be a human-readable date and time string in the default time zone, corresponding to the specified number of milliseconds since the epoch.

Source Code

import java.util.*;
public class Date_Constructor
{
	public static void main(String[] args)
	{
		Date date = new Date(732153600000L);
		System.out.println("Date : " + date);
	}
}

Output

Date : Mon Mar 15 05:30:00 IST 1993

Example Programs