Here you can find the source of getTimestampDate(long timestamp)
public static String getTimestampDate(long timestamp)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getTimestampDate(long timestamp) { return formatDate("dd.MM.yyyy", timestamp); }//from ww w .j a v a 2 s .c o m public static String formatDate(String format, long timestamp) { Date date = timestampToDate(timestamp); SimpleDateFormat f = new SimpleDateFormat(format); return f.format(date); } /** * Convert a unix timestamp to a Date object. The date object works with milliseconds while unix timestamps are * in seconds. * @param stamp long * @return Date */ public static Date timestampToDate(long stamp) { return new Date(stamp * 1000); } }