当前位置:网站首页>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
边栏推荐
- Mock测试
- DeepinV20安装Mariadb
- VMware 15pro mounts the hard disk of the real computer in the deepin system
- 快速安装mongodb
- On the multi-level certificate based on OpenSSL, the issuance and management of multi-level Ca, and two-way authentication
- 关于Jmeter启动闪退问题
- MYSQL一种分表实现方案及InnoDB、MyISAM、MRG_MYISAM等各种引擎应用场景介绍
- log4j 输出日志信息到文件中
- RecyclerView细节研究-RecyclerView点击错位问题的探讨与修复
- Jmeter设置环境变量支持在任意终端目录输入jmeter直接启动
猜你喜欢
随机推荐
多云数据流转?云上容灾?年前最后的价值内容分享
Use of WiFi module based on wechat applet
Jmeter设置环境变量支持在任意终端目录输入jmeter直接启动
On September 8, the night before going to Songshan Lake
mysql 5.1升级到5.69
Request module
关于NodeJS中JSON5的相关配置和使用
Installation and use of postman pit
星界边境Starbound创意工坊订阅的mod的存放路径
PyMySQL
On the problem of cliff growth of loss function in the process of training
RobotFramework 之 文件上传和下载
leetcode--977. Squares of a Sorted Array
线程间控制之CountDownLatch和CyclicBarrier使用介绍
Gartner预测云迁移规模大幅增长;云迁移的优势是什么?
logback-logger和root
JSP学习2
log4j 输出日志信息到文件中
Jmeter安装教程以及我遇到的问题的解决办法
Can global variables be defined in header files









