operator < method

bool operator <(
  1. DateTime otherDate
)

Returns true if left side is before Right side.

final checkDate = DateTime.now();   // 16-09-2023
checkDate.prevDay < DateTime.now()  // true
checkDate < DateTime.now()          // false

The comparison is independent of whether the time is in UTC or in the local time zone

Implementation

bool operator <(DateTime otherDate) => isBefore(otherDate);