setTime method

  1. @useResult
DateTime setTime({
  1. required TimeOfDay time,
})

Sets the time of the current DateTime to the specified TimeOfDay.

Returns a new DateTime with the same date but the given time.

Implementation

@useResult
DateTime setTime({required TimeOfDay time}) => DateTime(year, month, day, time.hour, time.minute);