Skip to content

Commit 3741cfc

Browse files
authored
修改了 “Java8 新特性 Date-Time API 格式化” 示例代码的注释
日期格式化 Java 8 之前的示例代码,原注释有误,与示例代码不对应,故此修正
1 parent 681c5ae commit 3741cfc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/java/new-features/java8-common-new-features.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -766,8 +766,8 @@ LocalTime.class //时间 format: HH:mm:ss
766766

767767
```java
768768
public void oldFormat(){
769-
Date now = new Date();
770-
//format yyyy-MM-dd HH:mm:ss
769+
Date now = new Date();
770+
//format yyyy-MM-dd
771771
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
772772
String date = sdf.format(now);
773773
System.out.println(String.format("date format : %s", date));

0 commit comments

Comments
 (0)