millisecondsSinceMidnight property

int get millisecondsSinceMidnight

The time as milliseconds since midnight.

DateTime(2023, 4, 1, 12).millisecondsSinceMidnight; // 43200000 ('12:00')

Implementation

int get millisecondsSinceMidnight =>
  hour * Duration.millisecondsPerHour +
  minute * Duration.millisecondsPerMinute +
  second * Duration.millisecondsPerSecond +
  millisecond;