SimpleDateFormat df = new SimpleDateFormat(“yyyyMMddHHmmss’Z’”);
SimpleDateFormat sdf = new SimpleDateFormat(“yyyy-MM-dd HH:mm:ss”);
df.setTimeZone(TimeZone.getTimeZone(“UTC”));
String entryTime = (String) createTimestamp;
entryTime = sdf.format(df.parse(entryTime));
JAVA 时间T Z格式转化为本地时间
于 2019-12-07 17:29:33 首次发布
本文介绍如何使用Java的SimpleDateFormat类将日期时间从一种格式转换到另一种格式,包括设置时区为UTC,解析和格式化字符串。
6613

被折叠的 条评论
为什么被折叠?



