public function withYear(int $year): DateTime
    {
        return new static(
            Date::create($year, $this->month(), $this->day()),
            $this->time(),
            $this->timezone()
        );
    }
public function withYear(int $year): DateTime
    {
        return new static(
            Date::create($year, $this->month(), $this->day()),
            $this->time(),
            $this->timezone()
        );
    }
public function withYear ( int $ year ) : DateTime { return new static ( Date :: create ( $ year , $ this -> month ( ) , $ this -> day ( ) ) , $ this -> time ( ) , $ this -> timezone ( ) ) ; }
Creates instance with a given year

@param int $year The year

@return DateTime

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