1
0
mirror of https://github.com/Snailclimb/JavaGuide synced 2025-08-05 20:31:37 +08:00

Merge pull request #1839 from 5ME/patch-1

修改了 “Java8 新特性 Date-Time API 格式化” 示例代码的注释
This commit is contained in:
Guide 2022-10-10 13:16:34 +08:00 committed by GitHub
commit bad509a777
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -766,8 +766,8 @@ LocalTime.class //时间 format: HH:mm:ss
```java
public void oldFormat(){
Date now = new Date();
//format yyyy-MM-dd HH:mm:ss
Date now = new Date();
//format yyyy-MM-dd
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String date = sdf.format(now);
System.out.println(String.format("date format : %s", date));