Compare()

DateTime::Compare(DateTime, DateTime) 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)

Arguments

ParameterTypeDescription
t1DateTimeThe first comparand
t2DateTimeThe second comparand

Return Value

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