2020-07-23T16:00:00.000Z 时间戳格式化

String date = "2020-07-23T16:00:00.000Z";
date = date.replace("Z", " UTC");
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS Z");
Date d = format.parse(date);

pojo中

@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    Date time;

你可能感兴趣的:(2020-07-23T16:00:00.000Z 时间戳格式化)