Spring Boot 2.6.4 所有日期和本地时间类型的变量仅给出数字而没有格式
我的 Spring Boot 项目有问题,我从版本 2.5.1
更新到 2.6.4
,现在所有变量类型为 date
和 < code>localtime 给出的数字没有格式 示例:
date = "2022-03-04" in JSON are "1646352000000"
和我的当地时间是这样的:有关
localtime = "09:00:00" in JSON is "9"
如何修复它的任何建议吗?
My spring boot project has a problem, I updated from version 2.5.1
to 2.6.4
and now all my variables of type date
and localtime
are given number without format
examples :
date = "2022-03-04" in JSON are "1646352000000"
and my localtime are like this :
localtime = "09:00:00" in JSON is "9"
any suggestions on how to fix it ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该配置 Jackson 以避免 Java 日期在时间戳中序列化。
你应该添加
and configure it like this :
You should configure Jackson in order to avoid serialization of Java dates in timestamp.
You should add
and configure it like this :