Share via


ZoneOffset.CompareTo(ZoneOffset) Method

Definition

Compares this offset to another offset in descending order.

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

Parameters

other
ZoneOffset

the other date to compare to, not null

Returns

the comparator value, negative if less, positive if greater

Attributes

Remarks

Compares this offset to another offset in descending order.

The offsets are compared in the order that they occur for the same time of day around the world. Thus, an offset of +10:00 comes before an offset of +09:00 and so on down to -18:00.

The comparison is "consistent with equals", as defined by Comparable.

Java documentation for java.time.ZoneOffset.compareTo(java.time.ZoneOffset).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to