localdatetime和datetime
时间: 2023-09-14 12:11:14 浏览: 94
Java中实现LocalDateTime与Date相互转化
LocalDateTime和DateTime都是Java 8中的日期时间类,用于表示不带时区的日期和时间。它们之间可以相互转换。对于LocalDateTime,我们可以使用`toLocalDate()`和`toLocalTime()`方法将其转换为LocalDate和LocalTime。同样地,我们也可以使用`atTime()`方法将LocalDate和LocalTime合并为LocalDateTime。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [Java8日期类LocalDateTime、LocalDate、DateTime常用方法介绍](https://blog.csdn.net/m0_60215634/article/details/130567027)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [Date、SimpleDateFormat和LocalDate、LocalTime、LocalDateTime、ZonedDateTime、DateTimeFormatter的使用...](https://blog.csdn.net/weixin_41979002/article/details/129101910)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文