LocalDate.Until Method

Definition

Overloads

Name Description
Until(IChronoLocalDate)

Calculates the period between this date and another date as a Period.

Until(ITemporal, ITemporalUnit)

Calculates the amount of time until another date in terms of the specified unit.

Until(IChronoLocalDate)

Calculates the period between this date and another date as a Period.

[Android.Runtime.Register("until", "(Ljava/time/chrono/ChronoLocalDate;)Ljava/time/Period;", "", ApiSince=26)]
public Java.Time.Chrono.IChronoPeriod? Until(Java.Time.Chrono.IChronoLocalDate? endDateExclusive);
[<Android.Runtime.Register("until", "(Ljava/time/chrono/ChronoLocalDate;)Ljava/time/Period;", "", ApiSince=26)>]
abstract member Until : Java.Time.Chrono.IChronoLocalDate -> Java.Time.Chrono.IChronoPeriod
override this.Until : Java.Time.Chrono.IChronoLocalDate -> Java.Time.Chrono.IChronoPeriod

Parameters

endDateExclusive
IChronoLocalDate

the end date, exclusive, which may be in any chronology, not null

Returns

the period between this date and the end date, not null

Implements

Attributes

Remarks

Calculates the period between this date and another date as a Period. This calculates the period between two dates in terms of years, months and days. The start and end points are 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. The calculation is performed using the ISO calendar system. If necessary, the input date will be converted to ISO. 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 2010-01-15 to 2011-03-18 is "1 year, 2 months and 3 days". There are two equivalent ways of using this method. The first is to invoke this method. The second is to use Period.between(LocalDate, LocalDate): The choice should be made based on which makes the code more readable.

Java reference for java.time.LocalDate.until.

Applies to

Until(ITemporal, ITemporalUnit)

Calculates the amount of time until another date in terms of the specified unit.

[Android.Runtime.Register("until", "(Ljava/time/temporal/Temporal;Ljava/time/temporal/TemporalUnit;)J", "", ApiSince=26)]
public long Until(Java.Time.Temporal.ITemporal? endExclusive, Java.Time.Temporal.ITemporalUnit? unit);
[<Android.Runtime.Register("until", "(Ljava/time/temporal/Temporal;Ljava/time/temporal/TemporalUnit;)J", "", ApiSince=26)>]
abstract member Until : Java.Time.Temporal.ITemporal * Java.Time.Temporal.ITemporalUnit -> int64
override this.Until : Java.Time.Temporal.ITemporal * Java.Time.Temporal.ITemporalUnit -> int64

Parameters

endExclusive
ITemporal

the end date, exclusive, which is converted to a LocalDate, not null

unit
ITemporalUnit

the unit to measure the amount in, not null

Returns

the amount of time between this date and the end date

Implements

Attributes

Remarks

Calculates the amount of time until another date in terms of the specified unit. This calculates the amount of time between two LocalDate objects in terms of a single TemporalUnit. The start and end points are this and the specified date. The result will be negative if the end is before the start. The Temporal passed to this method is converted to a LocalDate using from(TemporalAccessor). For example, the amount in days between two dates can be calculated using startDate.until(endDate, DAYS). The calculation returns a whole number, representing the number of complete units between the two dates. For example, the amount in months between 2012-06-15 and 2012-08-14 will only be one month as it is one day short of two months. There are two equivalent ways of using this method. The first is to invoke this method. The second is to use TemporalUnit.between(Temporal, Temporal): The choice should be made based on which makes the code more readable. The calculation is implemented in this method for ChronoUnit. The units DAYS, WEEKS, MONTHS, YEARS, DECADES, CENTURIES, MILLENNIA and ERAS are supported. Other ChronoUnit values will throw an exception. If the unit is not a ChronoUnit, then the result of this method is obtained by invoking TemporalUnit.between(Temporal, Temporal) passing this as the first argument and the converted input temporal as the second argument. This instance is immutable and unaffected by this method call.

Java reference for java.time.LocalDate.until.

Applies to