当前位置:网站首页>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
边栏推荐
猜你喜欢
MySQL数据库讲解(十)
RecyclerView高级使用(一)-侧滑删除的简单实现
01-NIO基础之ByteBuffer和FileChannel
Use of WiFi module based on wechat applet
Logback logger and root
RobotFramework 之 用例标签机制
Detailed tutorial on the use of smoke sensor (mq-2) (based on raspberry pie 3B +)
线程组ThreadGroup使用介绍+自定义线程工厂类实现ThreadFactory接口
OpenStack如何跨版本升级
MYSQL一种分表实现方案及InnoDB、MyISAM、MRG_MYISAM等各种引擎应用场景介绍
随机推荐
HyperBDR云容灾V3.3.0版本发布|容灾功能升级,资源组管理功能优化
Call wechat customer service applet
Redis数据库讲解(一)
Wechat applet initializes Bluetooth, searches nearby Bluetooth devices and connects designated Bluetooth (I)
更改plsql工具栏的图标大小
JDBC和servlet写CRUD的接口总结
POI operation word template replaces data and exports word
第四届“传智杯”全国大学生IT技能大赛(决赛B组) 题解
多云数据流转?云上容灾?年前最后的价值内容分享
Indoor and outdoor map switching (indoor three-point positioning based on ibeacons)
利用json-server在本地创建服务器请求
Promtail + Loki + Grafana 日志监控系统搭建
金融行业云迁移实践 平安金融云整合HyperMotion云迁移解决方案,为金融行业客户提供迁移服务
帆软分割求解:一段字符串,只取其中某个字符(所需要的字段)
Research on recyclerview details - Discussion and repair of recyclerview click dislocation
Logging module
Operation instructions of star boundary text automatic translator
JDBC details
关于云容灾,你需要知道这些
关于密匙传递的安全性和数字签名