System::DateTime::CompareTo method

DateTime::CompareTo method

Compares two date and time values represented by the current object and the specified instance of DateTime class and returns the value indicating values’ relative positions on the time line.

int System::DateTime::CompareTo(DateTime value) const
ParameterTypeDescription
valueDateTimeAn instance of DateTime class to compare the current object with

ReturnValue

A value that is less than 0 if the current object represents a value that is earlier than that represented by value; 0 if values represented by both objects are the same; a value that is greater than 0 if the value represented by the current object is later than that represented by value

See Also