OffsetTime.CompareTo(OffsetTime) Method

Definition

Compares this OffsetTime to another time.

[Android.Runtime.Register("compareTo", "(Ljava/time/OffsetTime;)I", "", ApiSince=26)]
public int CompareTo(Java.Time.OffsetTime? other);
[<Android.Runtime.Register("compareTo", "(Ljava/time/OffsetTime;)I", "", ApiSince=26)>]
member this.CompareTo : Java.Time.OffsetTime -> int

Parameters

other
OffsetTime

the other time to compare to, not null

Returns

the comparator value, that is the comparison of the UTC equivalent other instant, if they are not equal, and if the UTC equivalent other instant is equal, the comparison of this local time with other local time

Attributes

Remarks

Compares this OffsetTime to another time. The comparison is based first on the UTC equivalent instant, then on the local time. It is "consistent with equals", as defined by Comparable. For example, the following is the comparator order: 10:30+01:00 11:00+01:00 12:00+02:00 11:30+01:00 12:00+01:00 12:30+01:00 Values #2 and #3 represent the same instant on the time-line. When two values represent the same instant, the local time is compared to distinguish them. This step is needed to make the ordering consistent with equals(). To compare the underlying local time of two TemporalAccessor instances, use ChronoField.NANO_OF_DAY as a comparator.

Java reference for java.time.OffsetTime.compareTo.

Applies to