public function withDateAt(int $year = null, int $month = null, int $day = null) : self
    {
        if (null === $year && null === $month && null === $day) {
            return $this;
        }
        
        $year  = $year === null ? $this->year() : $year;
        $month = $month ?: $this->month();
        $day   = $day   ?: $this->day();
        
        $instance = clone $this;
        
        $instance->date->setDate($year, $month, $day);
        
        return $instance;
    }
public function withDateAt(int $year = null, int $month = null, int $day = null) : self
    {
        if (null === $year && null === $month && null === $day) {
            return $this;
        }
        
        $year  = $year === null ? $this->year() : $year;
        $month = $month ?: $this->month();
        $day   = $day   ?: $this->day();
        
        $instance = clone $this;
        
        $instance->date->setDate($year, $month, $day);
        
        return $instance;
    }
public function withDateAt ( int $ year = null , int $ month = null , int $ day = null ) : self { if ( null === $ year && null === $ month && null === $ day ) { return $ this ; } $ year = $ year === null ? $ this -> year ( ) : $ year ; $ month = $ month ? : $ this -> month ( ) ; $ day = $ day ? : $ this -> day ( ) ; $ instance = clone $ this ; $ instance -> date -> setDate ( $ year , $ month , $ day ) ; return $ instance ; }
Returns a new instance with the date set accordingly.

Any omitted values will default to the current value.

@param int $year
@param int $month
@param int $day

@return self
Returns a new instance with the date set accordingly .