NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

DateTime.CompareTo

Compares this instance to a specified object.

[Visual Basic]
Overridable Public Function CompareTo( _
   ByVal value As Object _
) As Integer
[C#]
public virtual int CompareTo(
   object value
);
[C++]
public: virtual int CompareTo(
   Object* value
);
[JScript]
public function CompareTo(
   value : Object
) : int;

Parameters

value
A DateTime value to compare to this instance .

Return Value

Value Type Condition
A negative integer If this instance is less than the value.
Zero If this instance and the value have the same value.
A positive integer If this instance is greater than the value.
A positive integer If the value is a null reference (in Visual Basic Nothing). This is a special case.

Exceptions

Exception Type Condition
ArgumentException If the value is not a DateTime.

Remarks

The CompareTo method implements CompareTo. When comparing two DateTime values, the number of ticks is used to determine the ordering.

The value parameter that is compared must be another DateTime or a null reference.

As a special case, an instance, regardless of its value, is considered to be greater than a null reference.

See Also

DateTime Structure | DateTime Members | System Namespace | Object | IComparable