字符串类型的:public static String formateTimeStempToString(long timeStemp){ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); return sdf.format(timeStemp); } 日期类型的:/*** 将毫秒数转换成日期类型 **/ public static Date formatTime(long time){ Date date = new Date(time); return date; }
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(timeStemp);
}
日期类型的:/*** 将毫秒数转换成日期类型 **/
public static Date formatTime(long time){
Date date = new Date(time);
return date;
}