Here you can find the source of secToDate(long secs, String format)
public static String secToDate(long secs, String format)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String secToDate(long secs, String format) { SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(new Date(secs * 1000L)); }/*from w ww.j a v a 2 s . c om*/ }