在使用springboot进行项目开发的时候在前端页面无法显示正确的时间
在application.xml中加入:
spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd
这两个配置
或者使用@JsonFormat(pattern=”yyyy-MM-dd HH:mm:ss”,timezone=”GMT+8”),放在实体类的属性上
在application.xml中加入:
spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd
这两个配置
或者使用@JsonFormat(pattern=”yyyy-MM-dd HH:mm:ss”,timezone=”GMT+8”),放在实体类的属性上