时间戳转时间字符串和时间

SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //造型随你喜欢
Long time=null;
//timestamp为需要转换的时间戳
time=new Long(String.valueOf(timestamp));
//转换成字符串
String timestr=format.format(time);
//转换成Date类型
format.parse(timestr);

顺便说一下,时间转时间戳是
date..getTime()
原文地址:https://www.cnblogs.com/IceBlueBrother/p/8423010.html