当前位置:网站首页>json date时间日期格式化
json date时间日期格式化
2022-04-23 14:08:00 【阿闰】
常用的三种日期格式化的注解解释如下:
//入参格式化注解
@DateTimeFormat(pattern=”yyyy-MM-dd HH:mm:ss”)
//出餐格式化注解
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JSONField(format = "yyyy-MM-dd HH:mm:ss") //建议这种
由于@RequestBody注解先将json字符串转换成对应的Vo对象,Vo对象中的字段上添加的注解再生效,@DateTimeFormat只是做格式化,无法做格式校验。
版权声明
本文为[阿闰]所创,转载请带上原文链接,感谢
https://blog.csdn.net/wasd986523/article/details/122127782
边栏推荐
- Wechat applet obtains login user information, openid and access_ token
- Win10 comes with groove music, which can't play cue and ape files. It's a curvilinear way to save the country. It creates its own aimpack plug-in package, and aimp installs DSP plug-in
- Oracle-数据泵使用
- mysql 5.1升级到5.610
- MYSQL 主从同步避坑版教程
- Some good articles on pthread multithreading
- VMware Workstation 无法连接到虚拟机。系统找不到指定的文件
- HyperBDR云容灾V3.3.0版本发布|容灾功能升级,资源组管理功能优化
- 帆软中需要设置合计值为0时,一整行都不显示的解决办法
- MySQL数据库讲解(九)
猜你喜欢
Research on recyclerview details - Discussion and repair of recyclerview click dislocation
帆软分割求解:一段字符串,只取其中某个字符(所需要的字段)
Operation instructions of star boundary text automatic translator
Wechat applet initializes Bluetooth, searches nearby Bluetooth devices and connects designated Bluetooth (I)
使用Executors类快速创建线程池
帆软中使用if else 进行判断-使用标题条件进行判断
Some experience of using dialogfragment and anti stepping pit experience (getactivity and getdialog are empty, cancelable is invalid, etc.)
VMWare安装64位XP中文教程
使用itextpdf实现截取pdf文档第几页到第几页,进行分片
快速安装mongodb
随机推荐
MySQL数据库讲解(七)
获取线程返回值Future接口与FutureTask类使用介绍
mysql 5.1升级到5.610
Mock测试
VMware 15pro mounts the hard disk of the real computer in the deepin system
按实际取,每三级分类汇总一次,看图知需求
MySQL数据库讲解(八)
log4j 输出日志信息到文件中
openstack理论知识
金融行业云迁移实践 平安金融云整合HyperMotion云迁移解决方案,为金融行业客户提供迁移服务
void*是怎样的存在?
VMWare安装64位XP中文教程
redis数据库讲解二(redis高可用、持久化、性能管理)
MYSQL 主从同步避坑版教程
贷款市场报价利率(LPR)与贷款基准利率介绍
封装logging模块
mysql 5.1升级到5.68
Some good articles on pthread multithreading
云容灾是什么意思?云容灾和传统容灾的区别?
更改plsql工具栏的图标大小