Freigeben über


Date.CompareTo(Date) Method

Definition

Compares two Dates for ordering.

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

Parameters

anotherDate
Date

the Date to be compared.

Returns

the value 0 if the argument Date is equal to this Date; a value less than 0 if this Date is before the Date argument; and a value greater than 0 if this Date is after the Date argument.

Attributes

Remarks

Compares two Dates for ordering.

Added in 1.2.

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

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