System::DateTime::Compare method

DateTime::Compare method

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

static constexpr int System::DateTime::Compare(DateTime t1, DateTime t2)
ParameterTypeDescription
t1DateTimeThe first comparand
t2DateTimeThe second comparand

ReturnValue

A value that is less than 0 if t1 is earlier than t2; 0 if t1 is the same as t2; a value that is greater than 0 if t1 is later than t2

See Also