JAVA8后的LocalDateTime
程序员文章站
2022-05-05 08:56:33
...
LocalDateTime now = LocalDateTime.now();
String result1 = now.format(DateTimeFormatter.ISO_DATE);
String result2 = now.format(DateTimeFormatter.BASIC_ISO_DATE);
String result3 = now.format(DateTimeFormatter.ofPattern("yyyy/MM/dd"));
结果 2020-01-08
20200108
2020/01/08
上一篇: 联想Y450开机音乐消除方法