mirror of
https://github.com/Snailclimb/JavaGuide
synced 2025-06-16 18:10:13 +08:00
commit
a2640ba393
@ -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));
|
||||
}
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user