In this section, you will learn to convert a millisecond into a date.
Convert Milliseconds to Date
In this section, you will learn to convert a millisecond into a date.
Description of program:
This program helps you in converting milliseconds into a date. It uses some java methods and APIs. you need a millisecond that have to be converted. The taken milliseconds is passed in the Date() constructor. It is then passed through the format() method that invokes with SimpleDateFormat() and it provides the given format.
The code of the program is given below:
import java.util.*;
|
The output of the program is given below:
C:\date>javac MillisecondToDate.java C:\date>java MillisecondToDate Jan 14,1970 04:23 |