OffsetTime.CompareTo(OffsetTime) 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.
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
A negative value, zero, or a positive value according to the ordering described in the remarks.
- Attributes
Remarks
Compares this OffsetTime to another time. The comparison first orders the instants obtained by applying both times to the same date, then compares local time if those instants are equal. 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 when applied to the same date. 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.