时间戳转换成固定格式
private final static String ERROR_TIME = "1970-01-01 00:00:00";
private final static String DEFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
private final static SimpleDateFormat fmt = new SimpleDateFormat(DEFAULT_DATE_FORMAT);
//时间日期格式的转化
public static String parseTimeStamp(Long time){
//1. 创建指定时间戳值的日类对象
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(time);
//2. 转换为日期格式
Date date = calendar.getTime();
//3. 转换
String format = fmt.format(date);
return format;
}