compareTo method

int compareTo(DateTime other)

Compares this DateTime object to other, returning zero if the values are equal.

This function returns a negative integer if this DateTime is smaller (earlier) than other, or a positive integer if it is greater (later).

Source

int compareTo(DateTime other) => _value.compareTo(other._value);

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/1.24.3/dart-core/DateTime/compareTo.html