var newHour = 5;
time = time.toLocal();
time = new DateTime(time.year, time.month, time.day, newHour, time.minute, time.second, time.millisecond, time.microsecond);
There were discussions to add an update()
method that allows to modify specific parts only, but it doesn’t look like this has landed.