Here you can find the source of getDateFromTime(long millisSinceMidnight)
public static Date getDateFromTime(long millisSinceMidnight)
//package com.java2s; //License from project: Creative Commons License import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.TimeZone; public class Main { /**// w w w. j av a 2 s . co m * @return the first date in 1970 with millisSinceMidnight added to it */ public static Date getDateFromTime(long millisSinceMidnight) { Calendar cal = GregorianCalendar.getInstance(TimeZone.getTimeZone("UTC +0")); Date date = new Date(); date.setTime(millisSinceMidnight); cal.setTime(date); return cal.getTime(); } }