1、在類的屬性上加註解@JsonFormat(timezone="GMT+8",pattern="yyyy-MM-dd");
2、在application.yml文件中添加:
spring:
jackson:
data-format:yyyy-MM-dd //字符串
time-zone:GMT+8
serialization:
write-dates-as-timestamps:true //使用數值表示日期
1、在類的屬性上加註解@JsonFormat(timezone="GMT+8",pattern="yyyy-MM-dd");
2、在application.yml文件中添加:
spring:
jackson:
data-format:yyyy-MM-dd //字符串
time-zone:GMT+8
serialization:
write-dates-as-timestamps:true //使用數值表示日期
Spring boot 配置數據源 spring: mvc: favicon: enabled: false datasource: primary: username: root