当前位置:网站首页>Localdatetime and string date conversion
Localdatetime and string date conversion
2022-06-10 11:23:00 【andQVQ】
LocalDateTime Turn into String
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime time = LocalDateTime.now();
String localTime = df.format(time);
be equal to
String localTime = MyDateUtil.formatDateTimeDefault(time);
System.out.println("LocalDateTime Turn into String Type of time :"+localTime);
result :
LocalDateTime Turn into String Type of time :2017-09-30 10:40:06
String Turn into LocalDateTime
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime ldt = LocalDateTime.parse("2017-09-28 17:07:05",df);
System.out.println("String The type of time turns into LocalDateTime:"+ldt);
result :
String The type of time turns into LocalDateTime:2017-09-28T17:07:05
边栏推荐
- How zoom closes the microphone when joining a meeting
- Why is your next computer a computer? Explore different remote operations
- 【Question】rxjs/operator takeWhile vs takeUntil
- 对接上百个第三方 API 后的思考与沉淀
- 定时刷数据库的数据,并只同步被修改的字段
- Practice of Flink CDC in Dajian cloud warehouse
- 【黄啊码】PHP7为什么比PHP5快两倍?
- 爱可可AI前沿推介(6.10)
- source observable 发生错误之后会直接进入到catchError operator 而不是按照pipe里面的顺序处理之后再进入catchError
- IDEA自定义配置链接nacos
猜你喜欢

zoom如何在加入会议时关闭microphone

【网易云信】深度剖析「圈组」消息系统设计 | 「圈组」技术系列文章

Flutter socketio example

2021年中国电子元件营收第一,揭秘立讯精密高质量发展之路

360, Tsinghua | zero and R2D2: a large-scale Chinese cross modal benchmark and visual language Framework

Analysis: a stable currency is not a "stable currency", but a product in essence

LVS+Keepalived高可用群集

Testing ovn manually based on LXD (by quqi99)

中国赛宝的面经

Dell G7 computer shutdown keypad
随机推荐
【黄啊码】PHP7为什么比PHP5快两倍?
On line monitoring of oil content in compressed air of power plant with PID photo ionization detector
In 2021, the revenue of China's electronic components will be the first, revealing the development path of precision and high quality of Tencent
【管理知多少】独立冲突之外,你做不到
Exception和Error有什么区别吗
[PaperNote] Web3 Direction
Fragment implements the switch of the bottom navigation bar without refreshing
Peking University and Microsoft | progress in reasoning to make language models better
Why is your next computer a computer? Explore different remote operations
Linked list, stack, queue
Weekly 5.28
对接上百个第三方 API 后的思考与沉淀
【Question】rxjs/operator takeWhile vs takeUntil
Google Earth Engine(GEE)——国家标识符网格数据集
Flutter websocket example
kubernetes 设置 Master 可调度与不可调度
爱可可AI前沿推介(6.10)
Software testing quality and assurance
【SignalR全套系列】之在.Net6中实现SignalR分组通信
Google Earth engine (GEE) - country identifier grid dataset