private LocalDateTime createDate;
如果不进行格式化,将会打印出带时区的时间格式
1970-01-01T08:00:00
那么如何才能把时区去掉呢?
加上@JsonFormat 注解将时间格式化 即可
@JsonFormat(shape= JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createDate;
现在就能打印出不打时区的时间了
"create_date": "1970-01-01 08:00:00"