当前位置:网站首页>@Datetimeformat received less than minutes and seconds, conversion times type exception
@Datetimeformat received less than minutes and seconds, conversion times type exception
2022-07-27 18:19:00 【StrugglingXuYang】
The error information is as follows
nopaexpiretimeFailed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'nopaexpiretime'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert
from type [java.lang.String] to type [@com.baomidou.mybatisplus.annotation.TableField
@org.springframework.format.annotation.DateTimeFormat java.util.Date] for value '2020-12-21 19:45:27'; nested
exception is java.lang.IllegalArgumentException: Parse attempt failed for value [2020-12-21 19:45:27]
It's actually a matter of time capitalization in annotations
@DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
Change it to uppercase
end
Add
receive json Data is used when
@JsonFormat(pattern = "yyyy-MM-dd") Add this comment on time
@PostMapping(value = "" ,produces = "application/json;charset=UTF-8")
@RequestBody receive json data
receive form Data is used when
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Valid receive form data Just make this comment on time
Record problems encountered in daily work , For future reference
2021-01-28 Supplementary content
In the use of @JsonFormat When the annotation , Need to add timezone = “GMT+8”;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
Otherwise, the time will still be poor 8 Hours
边栏推荐
- Golang worker pool
- The first PCIe 5.0 SSD master of Jiangsu Huacun: TSMC 12NM process, mass production in 2020
- 【云图说】 第249期 移动应用安全服务—App的体检中心,全面检测,安全上路!
- 深度学习:GAN案例练习-minst手写数字
- jpa连接数据库password字段BLOB
- 深度学习:STGCN学习笔记
- Three consecutive high-frequency interview questions of redis online celebrity: cache penetration? Cache breakdown? Cache avalanche?
- Local development using LWC in salesforce
- 宣布收购文晔30%股份,大联大意欲何为?
- Press Google and NVIDIA! Alibaba optical 800 chip won the world's first authoritative test again
猜你喜欢

Set up SSO based on SAML 2.0 in salesforce and enable JIT user provisioning (between SF orgs / between SF org and experience cloud / other IDPs)

数据库的常用命令2

发布自己的npm组件库

Exciting collection of new features released by salesforce

Salesforce File Share and Security

动态链表4单向循环链表(LoopSingle实现)

深度识别:论文阅读_2S-AGCN CVPR2019(基于骨架的动作识别的两流自适应图卷积网络)

动态链表3队列的链式存储结构(LinkedQueue实现)

最新大厂高级面试题 必备

Bug records using distributed framework WCF
随机推荐
1542. Find the longest super substring hash + state compression
面试常见问题一二
深度学习:GAN优化方法-DCGAN案例
Jianan Yunzhi has completed the pre roadshow and is expected to land on NASDAQ on November 20
嘉楠耘智已完成预路演,预计11月20日登陆纳斯达克
数据库的常用命令2
ts学习笔记-interface
联发科首款5G SoC来了!A77+G77+APU3.0,11月26日正式发布!
Year end summary template
Glory and Xiaomi reported on the double 11: they all called themselves champions
@Scheduled 和Quartz
Mysql四种锁
深度识别:论文阅读_2S-AGCN CVPR2019(基于骨架的动作识别的两流自适应图卷积网络)
Buffer的只读模式
二叉树概念
jpa连接数据库password字段BLOB
Bug records using distributed framework WCF
动态链表2栈的链表存储结构(LinkedStack实现)
@Scheduled and quartz
The global cloud market is growing rapidly, and data security has entered a strong regulatory era of rule of law