Here you can find the source of getTime(long time)
public static String getTime(long time)
//package com.java2s; //License from project: Open Source License import java.sql.Timestamp; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getTime(long time) { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); return format.format(new Date(time)); }//w ww .j a va2s . co m public static String getTime(Timestamp time) { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); return format.format(time); } }