1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| @Test public void LocalDateTest(){ log.debug("LocalDate => ISO_LOCAL_DATE 结果为 {}",LocalDate.now().format(DateTimeFormatter.ISO_LOCAL_DATE)); log.debug("LocalDate => ISO_DATE 结果为 {}",LocalDate.now().format(DateTimeFormatter.ISO_DATE)); log.debug("LocalDate => ISO_ORDINAL_DATE 结果为 {}",LocalDate.now().format(DateTimeFormatter.ISO_ORDINAL_DATE)); log.debug("LocalDate => ISO_WEEK_DATE 结果为 {}",LocalDate.now().format(DateTimeFormatter.ISO_WEEK_DATE)); log.debug("LocalDate => BASIC_ISO_DATE 结果为 {}",LocalDate.now().format(DateTimeFormatter.BASIC_ISO_DATE));
}
@Test public void LocalTimeTest(){ log.debug("LocalTime => ISO_LOCAL_TIME 结果为 {}",LocalTime.now().format(DateTimeFormatter.ISO_LOCAL_TIME)); log.debug("LocalTime => ISO_TIME 结果为 {}",LocalTime.now().format(DateTimeFormatter.ISO_TIME));
}
@Test public void LocalDateTimeTest(){ log.debug("LocalDateTime => ISO_LOCAL_DATE 结果为 {}",LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE)); log.debug("LocalDateTime => ISO_DATE 结果为 {}",LocalDateTime.now().format(DateTimeFormatter.ISO_DATE)); log.debug("LocalDateTime => ISO_LOCAL_TIME 结果为 {}",LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_TIME)); log.debug("LocalDateTime => ISO_TIME 结果为 {}",LocalDateTime.now().format(DateTimeFormatter.ISO_TIME)); log.debug("LocalDateTime => ISO_LOCAL_DATE_TIME 结果为 {}",LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)); log.debug("LocalDateTime => ISO_DATE_TIME 结果为 {}",LocalDateTime.now().format(DateTimeFormatter.ISO_DATE_TIME)); log.debug("LocalDateTime => ISO_ORDINAL_DATE 结果为 {}",LocalDateTime.now().format(DateTimeFormatter.ISO_ORDINAL_DATE)); log.debug("LocalDateTime => ISO_WEEK_DATE 结果为 {}",LocalDateTime.now().format(DateTimeFormatter.ISO_WEEK_DATE)); log.debug("LocalDateTime => BASIC_ISO_DATE 结果为 {}",LocalDateTime.now().format(DateTimeFormatter.BASIC_ISO_DATE)); log.debug("LocalDateTime.parse(\"2019-01-01\", DateTimeFormatter.ISO_DATE_TIME) {}",LocalDateTime.parse("2019-01-01",DateTimeFormatter.ISO_LOCAL_DATE)); }
|