1
0
mirror of https://github.com/Snailclimb/JavaGuide synced 2025-06-16 18:10:13 +08:00

Merge pull request #1228 from rain7fine11/patch-4

示例代码修正
This commit is contained in:
Guide哥 2021-06-07 10:43:33 +08:00 committed by GitHub
commit a2640ba393
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -798,6 +798,7 @@ public void newFormat(){
//format yyyy-MM-dd HH:mm:ss
LocalDateTime dateTime = LocalDateTime.now();
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
String dateTimeStr = dateTime.format(dateTimeFormatter);
System.out.println(String.format("dateTime format : %s", dateTimeStr));
}
```