SpringBoot 使用 jackson 格式化时间
SpringBoot 使用 jackson 格式化时间
在 application.yml或者properties中修改默认配置
yml
spring:
jackson:
date-format: yyyy/MM/dd
timezone: GMT+8properties
spring.jackson.date-format=yyyy-MM-dd HH:mm
spring.jackson.time-zone=GMT+8Bean
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
SpringBoot 使用 jackson 格式化时间
https://shikai.info/archives/springboot-use-jackson-formatting-time