public function withHour(int $hour): DateTime
    {
        return new static(
            $this->date(),
            Time::create($hour, $this->minute(), $this->second()),
            $this->timezone()
        );
    }
public function withHour(int $hour): DateTime
    {
        return new static(
            $this->date(),
            Time::create($hour, $this->minute(), $this->second()),
            $this->timezone()
        );
    }
public function withHour ( int $ hour ) : DateTime { return new static ( $ this -> date ( ) , Time :: create ( $ hour , $ this -> minute ( ) , $ this -> second ( ) ) , $ this -> timezone ( ) ) ; }
Creates instance with a given hour

@param int $hour The hour

@return DateTime

@throws DomainException When the date/time is not valid
Creates instance with a given hour