springboot配置返回时间戳
2018年08月31日 11:14:47 z_k_h 阅读数:1448
版权声明:希望对你有所帮助 https://blog.csdn.net/z_k_h/article/details/82253530
springboot2.0后,spring会将时间自动给转成UTC字符串了
springboot1.x版本的将date字段返回的是时间戳
配置返回时间戳
spring
jackson:
serialization:
write-dates-as-timestamps: true
- 1
- 2
- 3
- 4
全局配置返回字符串
spring:
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
- 1
- 2
- 3
- 4