public class DateUtils {
/**
* 将时间戳转换为日期格式
*/
public static String stampToDate(String s) {
String res;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long lt = new Long(s);
Date date = new Date(lt * 1000);
res = simpleDateFormat.format(date);
return res;
}
}
/**
* 将时间戳转换为日期格式
*/
public static String stampToDate(String s) {
String res;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long lt = new Long(s);
Date date = new Date(lt * 1000);
res = simpleDateFormat.format(date);
return res;
}
}