Calculates the period between this date and another date as a {@code Period}.
!(p)
This calculates the period between two dates _in terms of years, months and days.
The start and end points are {@code this} and the specified date.
The result will be negative if the end is before the start.
The negative sign will be the same _in each of year, month and day.
!(p)
The calculation is performed using the ISO calendar system.
If necessary, the input date will be converted to ISO.
!(p)
The start date is included, but the end date is not.
The period is calculated by removing complete months, then calculating
the remaining number of days, adjusting to ensure that both have the same sign.
The number of months is then normalized into years and months based on a 12 month year.
A month is considered to be complete if the end day-of-month is greater
than or equal to the start day-of-month.
For example, from {@code 2010-01-15} to {@code 2011-03-18} is "1 year, 2 months and 3 days".
!(p)
There are two equivalent ways of using this method.
The first is to invoke this method.
The second is to use {@link Period#between(LocalDate, LocalDate)}:
!(pre)
// these two lines are equivalent
period = start.until(end);
period = Period.between(start, end);
</pre>
The choice should be made based on which makes the code more readable.
@param endDateExclusive the end date, exclusive, which may be _in any chronology, not null
@return the period between this date and the end date, not null
Calculates the period between this date and another date as a {@code Period}. !(p) This calculates the period between two dates _in terms of years, months and days. The start and end points are {@code this} and the specified date. The result will be negative if the end is before the start. The negative sign will be the same _in each of year, month and day. !(p) The calculation is performed using the ISO calendar system. If necessary, the input date will be converted to ISO. !(p) The start date is included, but the end date is not. The period is calculated by removing complete months, then calculating the remaining number of days, adjusting to ensure that both have the same sign. The number of months is then normalized into years and months based on a 12 month year. A month is considered to be complete if the end day-of-month is greater than or equal to the start day-of-month. For example, from {@code 2010-01-15} to {@code 2011-03-18} is "1 year, 2 months and 3 days". !(p) There are two equivalent ways of using this method. The first is to invoke this method. The second is to use {@link Period#between(LocalDate, LocalDate)}: !(pre) // these two lines are equivalent period = start.until(end); period = Period.between(start, end); </pre> The choice should be made based on which makes the code more readable.
@param endDateExclusive the end date, exclusive, which may be _in any chronology, not null @return the period between this date and the end date, not null