时间毫秒值转换为时间字符串

时间毫秒值转换为时间字符串

/**
* 时间毫秒值转换为时间字符串
* @param format 时间格式
* @param timestamp 时间毫秒值
* @return
*/
public static String stampToTime(String format, long timestamp) {
Date date = new Date(timestamp);
try {
SimpleDateFormat sdf = new SimpleDateFormat(format);
return sdf.format(date);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
原文地址:https://www.cnblogs.com/gnpugongying/p/15124473.html