Days between two dates
import java.time.LocalDate;
import java.time.temporal.ChronoUnit;
public class DaysBetweenDates
{
public static void main(String[] args)
{
LocalDate date1 = LocalDate.now();
LocalDate date2 = date1.plusDays(99);
long diffInDays = ChronoUnit.DAYS.between(date1, date2);
System.out.println(diffInDays); // 99
}
}
LocalDate dateBefore;
LocalDate dateAfter;
long daysBetween = DAYS.between(dateBefore, dateAfter);