折雨的天空
org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deserialize value of type `java.util.Date`
2022-8-22 我好笨


java日期转换报错:



org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deserialize value of type `java.util.Date`







上面只是一部分。







解决办法:







在bo中,字段前面增加注解:



@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")



注意调整日期格式。







参考:https://www.jianshu.com/p/10a9a37d4606

发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容