Here you can find the source of getLongDisplayTime(long time)
public static String getLongDisplayTime(long time)
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { public static String getLongDisplayTime(long time) { Calendar cd = Calendar.getInstance(); cd.setTimeInMillis(time);/*w w w . ja v a 2 s . c o m*/ Date date = cd.getTime(); if (date == null) { return null; } DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); return dateformat.format(date); } }