java特殊时间转化问题
只需要在SpringBoot的配置文件里添加如下代码
1.application.yml
spring:
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
serialization:
#格式化输出
indent_output: true
#忽略无法转换的对象
fail_on_empty_beans: false
2.application.properties
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.time-zone=GMT+8
spring.jackson.serialization.indent_output=true
spring.jackson.serialization.fail_on_empty_beans=false
本文介绍如何在SpringBoot中配置Jackson来实现特定的时间格式化需求,包括日期和时间的显示格式及时间区域设置。

被折叠的 条评论
为什么被折叠?



