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:
commit
bad509a777
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user