SpringBoot接收对象中包含时间参数,格式化接收时间

Posted 尘世间迷茫的小书童

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SpringBoot接收对象中包含时间参数,格式化接收时间相关的知识,希望对你有一定的参考价值。

SpringBoot接收对象中包含时间参数,前端传过来的时间数据为\'2019-12-19 08:08:08\',SpringBoot不能自己转化时间为Date,会报错。

解决办法:

使用@JsonFormat注解

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

 

以上是关于SpringBoot接收对象中包含时间参数,格式化接收时间的主要内容,如果未能解决你的问题,请参考以下文章

插入数据时出错 java.time.LocalDate 在 SpringBoot 中包含字段 dateOfBirth 类型 LocalDate

post 传递参数中包含 html 代码解决办法,js加密,.net解密

在枚举python中包含停止参数的最简单方法?

我是这样使用SpringBoot(API传参)

如何在 MailChimp 确认页面 url 中包含 URL 参数

在 GeoJson 对象中包含 JSON 流?