Expand Minimize

Calendar.CompareDateTime | compareDateTime method

Applies to Windows and Windows Phone

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.

Syntax


public:
int CompareDateTime(
  DateTime other
)

Parameters

other

Type: Date [JavaScript] | System.DateTimeOffset [.NET] | Windows::Foundation::DateTime [C++]

The DateTime object to compare to the current calendar.

Return value

Type: Number [JavaScript] | System.Int32 [.NET] | int32 [C++]

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.

 

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.Globalization
Windows::Globalization [C++]

Metadata

Windows.winmd

See also

Calendar

 

 

Show:
© 2014 Microsoft