convert long to date in java

Solutions on MaxInterview for convert long to date in java by the best coders in the world

showing results for - "convert long to date in java"
Sohan
22 Feb 2017
1//The Date constructor (click the link!) accepts the time as long in milliseconds, not seconds.
2long currentDateTime = System.currentTimeMillis();
3//creating Date from millisecond
4Date currentDate = new Date(currentDateTime);