java中localdatetime构造方法
时间: 2023-09-25 16:15:05 浏览: 115
在Java中,可以使用`LocalDateTime.now()`方法来获取当前系统时间,返回一个`LocalDateTime`对象。此外,还可以使用`LocalDateTime.of()`方法来构造带参数的`LocalDateTime`对象。该方法的参数依次表示年、月、日、时、分、秒。通过这两种方法,我们可以创建并获取`LocalDateTime`对象。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [java的时间和日期API:LocalDateTime,LocalDate,LocalTime](https://blog.csdn.net/m0_46306264/article/details/118662864)[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* [LocalDateTime类相关操作](https://blog.csdn.net/XiaoBoYes/article/details/125796504)[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 ]
阅读全文