src/LocalDateTime.php
public function withDate(LocalDate $date) : LocalDateTime
    {
        if ($date->isEqualTo($this->date)) {
            return $this;
        }

        return new LocalDateTime($date, $this->time);
    }
public function withDate(LocalDate $date) : LocalDateTime
    {
        if ($date->isEqualTo($this->date)) {
            return $this;
        }

        return new LocalDateTime($date, $this->time);
    }
public function withDate ( LocalDate $ date ) : LocalDateTime { if ( $ date -> isEqualTo ( $ this -> date ) ) { return $ this ; } return new LocalDateTime ( $ date , $ this -> time ) ; }
Returns a copy of this LocalDateTime with the date altered.

@param LocalDate $date

@return LocalDateTime
Returns a copy of this LocalDateTime with the date altered .