使用org.threeten.bp.temporal.ChronoUnit.between方法:long days = ChronoUnit.DAYS.between(fromDate, toDate);
LocalDateTime
而不是LocalDate
,否则会出现异常。 - RominaV