1. You can add the following configuration to apllication.property
#Uniform timestamp conversion
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.time-zone=GMT+8
two,
@JsonFormat(timezone = "GMT+8", pattern = "yyyyMMddHHmmss")
private Date createTime;
3. You can add the following configuration to apllication.yml (recommended)
spring:
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss