springboot jackson日期序列化配置

springboot2.0后会将date自动给转成UTC字符串

配置springboot2.x将date转换为时间戳:

spring.jackson.serialization.write-dates-as-timestamps=true

配置springboot2.x将date格式化后再返回:

spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.time-zone=GMT+8

发布了56 篇原创文章 · 获赞 6 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/luo15242208310/article/details/103045352