Share via


Calendar.CompareTo(Calendar) Method

Definition

Compares the time values (millisecond offsets from the "#Epoch">Epoch) represented by two Calendar objects.

[Android.Runtime.Register("compareTo", "(Ljava/util/Calendar;)I", "GetCompareTo_Ljava_util_Calendar_Handler")]
public virtual int CompareTo (Java.Util.Calendar anotherCalendar);
[<Android.Runtime.Register("compareTo", "(Ljava/util/Calendar;)I", "GetCompareTo_Ljava_util_Calendar_Handler")>]
abstract member CompareTo : Java.Util.Calendar -> int
override this.CompareTo : Java.Util.Calendar -> int

Parameters

anotherCalendar
Calendar

the Calendar to be compared.

Returns

the value 0 if the time represented by the argument is equal to the time represented by this Calendar; a value less than 0 if the time of this Calendar is before the time represented by the argument; and a value greater than 0 if the time of this Calendar is after the time represented by the argument.

Attributes

Exceptions

if the argument is null.

if the argument does not include a valid time value.

Remarks

Java documentation for java.util.Calendar.compareTo(java.util.Calendar).

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