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


版权声明:本文为luo15242208310原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。