Here you can find the source of unixTimeToDate(long unixTime)
public static Date unixTimeToDate(long unixTime)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.*; public class Main { public static Date unixTimeToDate(long unixTime) { //long unixSeconds = 1372339860; Date date = new Date(unixTime * 1000L); // *1000 is to convert seconds to milliseconds SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z"); // the format of your date //sdf.setTimeZone(TimeZone.getTimeZone("GMT+3")); // give a timezone reference for formating (see comment at the bottom String formattedDate = sdf.format(date); System.out.println(formattedDate); return date; }/* w w w . ja v a 2 s . co m*/ }