计算两个时间类型LocalDate合着LocalDateTime之间相差天数


LocalDate startDate = LocalDate.of(2020, Month.JANUARY, 1);
LocalDate endDate = LocalDate.of(2021, Month.JANUARY, 1);
long daysBetween = ChronoUnit.DAYS.between(startDate, endDate);
System.out.println("Days between: " + daysBetween);

 

posted @ 2023-04-14 08:53  Joker-0927  阅读(226)  评论(0编辑  收藏  举报
// 侧边栏目录