Calendar.CompareDateTime(DateTime) Calendar.CompareDateTime(DateTime) Calendar.CompareDateTime(DateTime) Calendar.CompareDateTime(DateTime) Calendar.CompareDateTime(DateTime) Method

Definition

Compares this calendar to a DateTime object and indicates whether the date and time of one is earlier, equal to, or later than that of the other.

public : int CompareDateTime(DateTime other)
int32_t CompareDateTime(DateTime other) const;
public int CompareDateTime(DateTimeOffset other)
Public Function CompareDateTime(other As DateTimeOffset) As int
var int = calendar.compareDateTime(other);

Parameters

other
DateTimeOffset DateTimeOffset DateTimeOffset

The DateTime object to compare to the current calendar.

Returns

int int int

One of the following values:

Return valueDescription
Less than zeroThe date and time of this calendar is earlier than that of *other*.
ZeroThe date and times are equal.
Greater than zeroThe date and time of this calendar is later than that of *other*.