If I do:
public static void main(String[] args) {
LocalDate d1 = LocalDate.of(2015, Month.MARCH, 12);
LocalDate d2 = LocalDate.of(2015, Month.APRIL, 13);
System.out.println(d1.until(d2).getDays());
// Prints 11
LocalDate d3 = LocalDate.of(2015, Month.APRIL, 25);
// Prints 23.
Both of which are incorrect. The second output makes sense as there is 1 month and 23 days between them.
How do I get the total number of days between?
I would want the first output to be 32 Days and the second to be 44 days (the total number of days between the two dates).
What am I doing wrong? I don't see a totalDays()
method.