Here you can find the source of longTimeToDate(long miliseconds)
public static String longTimeToDate(long miliseconds)
//package com.java2s; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static final DateFormat AGO_FULL_DATE_FORMATTER = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss"); public static String longTimeToDate(long miliseconds) { Date dt = new Date(miliseconds); return AGO_FULL_DATE_FORMATTER.format(dt); }//from w w w .j a v a 2 s . com }