DateTimeFormatter java.time.format
@Test
public void test4(){
DateTimeFormatter isoLocalDateTime = DateTimeFormatter.ISO_LOCAL_DATE_TIME;
LocalDateTime now = LocalDateTime.now();
String format = isoLocalDateTime.format(now);
System.out.println(now);
System.out.println(format);
TemporalAccessor parse = isoLocalDateTime.parse("2021-06-06T23:51:52.479624");
System.out.println(parse);
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.SHORT);
LocalDateTime localDateTime = LocalDateTime.now();
String format1 = dateTimeFormatter.format(localDateTime);
System.out.println("FormatStyle.SHORT"+format1);
System.out.println("标准:"+localDateTime);
DateTimeFormatter formatter = DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL);
String format2 = formatter.format(LocalDate.now());
System.out.println("FormatStyle.FULL"+format2);
DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd hh:mm:ss E");
System.out.println(LocalDateTime.now());
String format3 = formatter1.format(LocalDateTime.now());
System.out.println(format3);
TemporalAccessor parse1 = formatter1.parse("2021-06-07 12:21:22 周一");
System.out.println(parse1);
}