当前位置:网站首页>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
边栏推荐
- Indoor and outdoor map switching (indoor three-point positioning based on ibeacons)
- CDH cluster integration Phoenix based on CM management
- Research on recyclerview details - Discussion and repair of recyclerview click dislocation
- DDT+Excel进行接口测试
- VMware Workstation 无法连接到虚拟机。系统找不到指定的文件
- 容灾有疑问?点这里
- MySQL数据库讲解(九)
- 修改ddt生成的测试用例名称
- JDBC和servlet写CRUD的接口总结
- Call wechat customer service applet
猜你喜欢

Installation and use of postman pit

squid代理

帆软中使用if else 进行判断-使用标题条件进行判断

Three point positioning based on ibeacons (wechat applet)

Some experience of using dialogfragment and anti stepping pit experience (getactivity and getdialog are empty, cancelable is invalid, etc.)

Wechat applet positioning and ranging through low-power Bluetooth device (2)

Recyclerview advanced use (I) - simple implementation of sideslip deletion

在Clion中给主函数传入外部参数

Operation instructions of star boundary text automatic translator

Idea控制台乱码解决
随机推荐
更改plsql工具栏的图标大小
第四届“传智杯”全国大学生IT技能大赛(决赛B组) 题解
Use of WiFi module based on wechat applet
服务器日志分析工具(识别,提取,合并,统计异常信息)
修改ddt生成的测试用例名称
星界边境文本自动翻译机(高级版)使用说明
VMware15Pro在Deepin系统里面挂载真机电脑硬盘
Jmeter安装教程以及我遇到的问题的解决办法
帆软实现一个单选按钮,可以统一设置其他单选按钮的选择状态
什么是云迁移?云迁移的四种模式分别是?
OpenStack命令操作
使用DialogFragment的一些感受及防踩坑经验(getActivity、getDialog为空,cancelable无效等)
Call wechat customer service applet
线程组ThreadGroup使用介绍+自定义线程工厂类实现ThreadFactory接口
leetcode--977. Squares of a Sorted Array
帆软中需要设置合计值为0时,一整行都不显示的解决办法
不同时间类型的执行计划计算
Logback logger and root
MySQL数据库讲解(七)
Three point positioning based on ibeacons (wechat applet)