Here you can find the source of getDateByNum(String dateNum)
public static String getDateByNum(String dateNum)
//package com.java2s; //License from project: Apache License import java.sql.Timestamp; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static final String C_DATE_PATTON_DEFAULT = "yyyy-MM-dd"; public static String getDateByNum(String dateNum) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); String date = sdf.format(new Date((long) (Double .parseDouble(dateNum) * 1000))); return date; }/*from ww w. jav a 2 s. c o m*/ public static String format(Date aTs_Datetime) { return format(aTs_Datetime, C_DATE_PATTON_DEFAULT); } public static String format(Date aTs_Datetime, String as_Pattern) { if (aTs_Datetime == null || as_Pattern == null) return null; SimpleDateFormat dateFromat = new SimpleDateFormat(); dateFromat.applyPattern(as_Pattern); return dateFromat.format(aTs_Datetime); } /** * @param aTs_Datetime * @param as_Pattern * @return */ public static String format(Timestamp aTs_Datetime, String as_Pattern) { if (aTs_Datetime == null || as_Pattern == null) return null; SimpleDateFormat dateFromat = new SimpleDateFormat(); dateFromat.applyPattern(as_Pattern); return dateFromat.format(aTs_Datetime); } }