midnight method

DateTime midnight({
  1. int daysAgo = 0,
})

get the current day with all small time units equal to zero

Implementation

DateTime midnight({int daysAgo = 0}) => DateTime(year, month, day - daysAgo);