java获取两个日期的间隔天数
解决方法:
假如要获取2021-11-01和20211105之间的间隔天数,结果就是4
LocalDate date = LocalDate.parse("2021-11-01", TimeFormatUtils.FORMATTER_DATE_2);
LocalDate date2 = LocalDate.parse("2021-11-05", TimeFormatUtils.FORMATTER_DATE_2);
int days = Period.between(date,date2).getDays();