Period.Between(LocalDate, LocalDate) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Obtains a Period consisting of the number of years, months, and days between two dates.
[Android.Runtime.Register("between", "(Ljava/time/LocalDate;Ljava/time/LocalDate;)Ljava/time/Period;", "", ApiSince=26)]
public static Java.Time.Period? Between(Java.Time.LocalDate? startDateInclusive, Java.Time.LocalDate? endDateExclusive);
[<Android.Runtime.Register("between", "(Ljava/time/LocalDate;Ljava/time/LocalDate;)Ljava/time/Period;", "", ApiSince=26)>]
static member Between : Java.Time.LocalDate * Java.Time.LocalDate -> Java.Time.Period
Parameters
- startDateInclusive
- LocalDate
the start date, inclusive, not null
- endDateExclusive
- LocalDate
the end date, exclusive, not null
Returns
the period between this date and the end date, not null
- Attributes
Remarks
Obtains a Period consisting of the number of years, months, and days between two dates. 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 split into years and months based on a 12 month year. A month is considered if the end day-of-month is greater than or equal to the start day-of-month. For example, from 2010-01-15 to 2011-03-18 is one year, two months and three days. The result of this method can be a negative period if the end is before the start. The negative sign will be the same in each of year, month and day.
Java reference for java.time.Period.between.