java如何将时间戳转换为时间字符串

如题所述

public static String getStrTime(String cc_time) {
String re_StrTime = null;

SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日HH时mm分ss秒");
// 例如:cc_time=1291778220
long lcc_time = Long.valueOf(cc_time);
re_StrTime = sdf.format(new Date(lcc_time * 1000L));

return re_StrTime;

}
温馨提示:答案为网友推荐,仅供参考
相似回答