Here you can find the source of timeStamp2Date(String seconds, String format)
public static String timeStamp2Date(String seconds, String format)
//package com.java2s; //License from project: Artistic License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String timeStamp2Date(String seconds, String format) { if (seconds == null || seconds.isEmpty() || seconds.equals("null")) { return ""; }/*w ww.j a v a2s . com*/ if (format == null || format.isEmpty()) format = "yyyy-MM-dd HH:mm:ss"; SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(new Date(Long.valueOf(seconds))); } }