@Test public void testTime() { var d1 = LocalDate.of(2021,1,1); var d2 = LocalDate.of(2021,7,2); Period p = Period.between(d1, d2); System.out.println(p.getDays()); System.out.println(d2.toEpochDay() - d1.toEpochDay()); }
2024-01-15 15:58:22
@Test public void testTime() { var d1 = LocalDate.of(2021,1,1); var d2 = LocalDate.of(2021,7,2); Period p = Period.between(d1, d2); System.out.println(p.getDays()); System.out.println(d2.toEpochDay() - d1.toEpochDay()); }