## 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.

```cpp
static constexpr int System::DateTime::Compare(DateTime t1, DateTime t2)
```


| Parameter | Type | Description |
| --- | --- | --- |
| t1 | DateTime | The first comparand |
| t2 | DateTime | The 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

* Class [DateTime](../)
* Class [DateTime](../)
* Namespace [System](../../)
* Library [Aspose.Page for C++](../../../)
