public LocalDateTime withHour(int hour) {
        LocalTime newTime = time.withHour(hour);
        return with(date, newTime);
    }
public LocalDateTime withHour ( int hour ) { LocalTime newTime = time . withHour ( hour ) ; return with ( date , newTime ) ; }
Returns a copy of this {@code LocalDateTime} with the hour-of-day altered.
<p>
This instance is immutable and unaffected by this method call.

@param hour  the hour-of-day to set in the result, from 0 to 23
@return a {@code LocalDateTime} based on this date-time with the requested hour, not null
@throws DateTimeException if the hour value is invalid