当前位置:网站首页>日期处理,字符串日期格式转换
日期处理,字符串日期格式转换
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格式的字符串类型
边栏推荐
猜你喜欢
随机推荐
makefile记录
io.lettuce.core。RedisCommandTimeoutException命令超时
安装flask
01 自然语言处理NLP介绍
SIGINT, SIGKILL, SIGTERM signal difference, summary of various signals
leetcode:55. 跳跃游戏
高项 04 项目整体管理
Thread Pool Summary
eyb:Redis学习(2)
【sqlite3】sqlite3.OperationalError: table addresses has 7 columns but 6 values were supplied
Flask failed to create database without error
2022年7月小结
简单使用Lambda表达式
网络学习总结
Example of using the cut command
leetcode 之 70 爬楼梯问题 (斐波那契数)
Zero shift of leetcode
错误:为 repo ‘oracle_linux_repo‘ 下载元数据失败 : Cannot download repomd.xml: Cannot download repodata/repomd.
SIGINT,SIGKILL,SIGTERM信号区别,各类信号总结
way of thinking problem-solving skills