getDateTimeDayStart function

DateTime getDateTimeDayStart([
  1. DateTime? time
])

Returns the start of the day for time.

time if null uses DateTime.now .

Implementation

DateTime getDateTimeDayStart([DateTime? time]) {
  time ??= DateTime.now();
  return DateTime(time.year, time.month, time.day, 0, 0, 0, 0, 0);
}