会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
我也有梦想呀
喜欢就努力的争取
博客园
首页
新随笔
联系
订阅
管理
解决Springboot中的日期解析错误
错误信息:
error: Failed to parse Date value '2022-01-12 15:00:00': Cannot parse date "2022-01-12 15:00:00": while it seems to fit format 'yyyy-MM-dd'T'HH:mm:ss.SSSZ', parsing fails (leniency? null)
解决办法:
使用fastJson,在日期属性上添加 org.springframework.format.annotation.DateTimeFormat ---> @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
com.fasterxml.jackson.annotation.JsonFormat ---> @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
posted @
2022-01-19 01:37
我也有梦想呀
阅读(
1663
) 评论(
0
)
收藏
举报
刷新页面
返回顶部
公告