1.Java 星期几 (JDK8)

1.星期几取得:

LocalDate date = LocalDate.now();

DateTimeFormatter formatter = DateTimeFormatter.ofPattern("E");

String text = date.format(formatter);

System.out.println("测试..." + text);

2.JDK API得注释:

All letters 'A' to 'Z' and 'a' to 'z' are reserved as pattern letters. The following pattern letters are defined:

1.Java 星期几 (JDK8)_第1张图片

你可能感兴趣的:(1.Java 星期几 (JDK8))