Language

IChronoZonedDateTime.CompareTo(IChronoZonedDateTime) Method

Definition

Compares this date-time to another date-time, including the chronology.

[Android.Runtime.Register("compareTo", "(Ljava/time/chrono/ChronoZonedDateTime;)I", "GetCompareTo_Ljava_time_chrono_ChronoZonedDateTime_Handler:Java.Time.Chrono.IChronoZonedDateTime, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]
public virtual int CompareTo(Java.Time.Chrono.IChronoZonedDateTime? other);
[<Android.Runtime.Register("compareTo", "(Ljava/time/chrono/ChronoZonedDateTime;)I", "GetCompareTo_Ljava_time_chrono_ChronoZonedDateTime_Handler:Java.Time.Chrono.IChronoZonedDateTime, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]
abstract member CompareTo : Java.Time.Chrono.IChronoZonedDateTime -> int
override this.CompareTo : Java.Time.Chrono.IChronoZonedDateTime -> int

Parameters

other
IChronoZonedDateTime

the other date-time to compare to, not null

Returns

the comparator value, that is the comparison of this with the other values for the instant, the local date-time, the zone ID, and the chronology, in order, returning the first non-zero result, and otherwise returning zero

Attributes

Remarks

Compares this date-time to another date-time, including the chronology. The comparison is based first on the instant, then on the local date-time, then on the zone ID, then on the chronology. It is "consistent with equals", as defined by Comparable. If all the date-time objects being compared are in the same chronology, then the additional chronology stage is not required. This default implementation performs the comparison defined above.

Java reference for java.time.chrono.ChronoZonedDateTime.compareTo.

Applies to