LocalDate date = LocalDate.of(2014, 3, 18);
String s1 = date.format(DateTimeFormatter.BASIC_ISO_DATE);
String s2 = date.format(DateTimeFormatter.ISO_LOCAL_DATE);
System.out.println(s1); // 20140318
System.out.println(s2); // 2014-03-18
时间格式化输出
最新推荐文章于 2023-07-10 17:55:31 发布