setTime method

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

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

Args: time (TimeOfDay): The time to set.

Returns: DateTime: A new DateTime object with the updated time.

Implementation

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