isMidnight property

bool get isMidnight

Checks if the current time is exactly midnight (00:00:00.000000).

All time components — including milliseconds and microseconds — must be zero. A time of 00:00:00.001 is not considered midnight.

Returns: bool: True if the time is exactly midnight, false otherwise.

Implementation

bool get isMidnight =>
    hour == 0 && minute == 0 && second == 0 && millisecond == 0 && microsecond == 0;