parent
e1f43460ac
commit
131740dee1
@ -12,6 +12,7 @@ public static void main(String[] args) {
|
|||||||
|
|
||||||
String dateStr = "20210719"; // 输入日期字符串
|
String dateStr = "20210719"; // 输入日期字符串
|
||||||
|
|
||||||
|
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd"); // 定义日期格式化模式
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd"); // 定义日期格式化模式
|
||||||
LocalDate localDate = LocalDate.parse(dateStr, formatter); // 将字符串按指定格式解析为LocalDate对象
|
LocalDate localDate = LocalDate.parse(dateStr, formatter); // 将字符串按指定格式解析为LocalDate对象
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user