当前位置:网站首页>日期处理,字符串日期格式转换
日期处理,字符串日期格式转换
2022-08-09 06:50:00 【EntyIU】
1.date类型转换为其它格式的字符串类型
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd")
String format = df.format(a.getOperationTime());//即可获得对应格式的额时间字符串
2.一个字符串类型的时间串转换格式
String dateStr = "2017-03-01";
Date date = DateUtil.parse(dateStr);//将字符串转化为date类型
String s = DateUtil.formatDate(date);//将时间类型转换为yyyy-MM-dd格式的字符串类型
边栏推荐
- 分布式事务的应用场景
- Search 1688 product interface by image (item_search_img-search 1688 product by image (Politao interface) code docking tutorial
- 先序遍历,中序遍历,后序遍历,层序遍历
- Use of PlantUML plugin in idea
- 买口罩(0-1背包)
- 输入框最前面添加放大镜&&background-image和background-color冲突问题
- 常用Oracle命令
- 报错:flask: TypeError: ‘function‘ object is not iterable
- The AD in the library of library file suffix. Intlib. Schlib. Pcblib difference
- Fragments
猜你喜欢
db.sqlite3没有“as Data Source“解决方法
C language implements sequential stack and chain queue
细谈VR全景:数字营销时代的宠儿
代码目录结构
ByteDance Interview Questions: Mirror Binary Tree 2020
分布式理论
长沙学院2022暑假训练赛(一)六级阅读
Inception V3 闭眼检测
虚拟机网卡报错:Bringing up interface eth0: Error: No suitable device found: no device found for connection
XILINX K7 FPGA+RK3399 PCIE驱动调试
随机推荐
虚拟机网卡报错:Bringing up interface eth0: Error: No suitable device found: no device found for connection
Introduction and use of BeautifulSoup4
Service
Error jinja2.exceptions.UndefinedError: 'form' is undefined
Use of PlantUML plugin in idea
代码目录结构
如何 认识与学习BASH
idea中PlantUML插件使用
The JVM thread state
多米诺骨牌
图论,二叉树,dfs,bfs,dp,最短路专题
jvm线程状态
SIGINT, SIGKILL, SIGTERM signal difference, summary of various signals
Reverse Engineering
力扣第 305 场周赛复盘
Example of using the cut command
golang zip aes base64
【Docker】Docker安装MySQL
TCP段重组PDU
The water problem of leetcode