当前位置:网站首页>@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
边栏推荐
猜你喜欢
随机推荐
Is it difficult to operate email safely? COREMAIL joins hands with cloud store to create a new ecosystem of corporate email office!
联发科首款5G SoC来了!A77+G77+APU3.0,11月26日正式发布!
类的六大关系——依赖和关联的区别
收藏!0 基础开源数据可视化平台 FlyFish 大屏开发指南
Year end summary template
浅论分布式训练中的recompute机制
动态链表3队列的链式存储结构(LinkedQueue实现)
Dbeaver connection MySQL error: the server time zone value 'Ö Ð¹ ú±ê ×¼ ʱ ¼ ä‘ is unrecognized or represents more than
MySql代码数据库创建 停车管理系统 外键
浅谈AI深度学习的模型训练和推理
The global cloud market is growing rapidly, and data security has entered a strong regulatory era of rule of law
【云图说】 第249期 移动应用安全服务—App的体检中心,全面检测,安全上路!
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)
Redis网红高频面试题三连:缓存穿透?缓存击穿?缓存雪崩?
深度学习:GAN优化方法-DCGAN案例
图形界面编程
SQL Server连接到服务器无效的解决办法
canvas根据坐标点绘制图形
hutool- 数字计算
1542. 找出最长的超赞子字符串 哈希+状态压缩









