java 世界标准时间UTC时间转北京时间GST
2019-07-16 本文已影响0人
_嘛喳喳_
String formatPattern = "yyyy-MM-dd HH:mm:ss";
String utc = "2019-07-10T16:00:00.000Z";
ZonedDateTime zdt = ZonedDateTime.parse(utc);
LocalDateTime localDateTime = zdt.toLocalDateTime();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(formatPattern);
String gst = formatter.format(localDateTime.plusHours(8));