LocalDate

LocalDate start = LocalDate.of(2020, 12, 27);
Period period = Period.between(start, LocalDate.now());
// 日期相差
int days = period.getDays();
// 相差月份
int months = period.getMonths();
// 相差年份
int years = period.getYears();
System.out.println(days +"-"+ months +"-"+ years);
// 更准确 - 开发用这个,省事
long dayse = LocalDate.now().toEpochDay() - start.toEpochDay();
System.out.println("相差天数" + dayse);