src/LocalDateTime.php
public function plusDuration(Duration $duration) : LocalDateTime
    {
        if ($duration->isZero()) {
            return $this;
        }

        $days = Math::floorDiv($duration->getSeconds(), LocalTime::SECONDS_PER_DAY);

        return new LocalDateTime($this->date->plusDays($days), $this->time->plusDuration($duration));
    }
public function plusDuration(Duration $duration) : LocalDateTime
    {
        if ($duration->isZero()) {
            return $this;
        }

        $days = Math::floorDiv($duration->getSeconds(), LocalTime::SECONDS_PER_DAY);

        return new LocalDateTime($this->date->plusDays($days), $this->time->plusDuration($duration));
    }
public function plusDuration ( Duration $ duration ) : LocalDateTime { if ( $ duration -> isZero ( ) ) { return $ this ; } $ days = Math :: floorDiv ( $ duration -> getSeconds ( ) , LocalTime :: SECONDS_PER_DAY ) ; return new LocalDateTime ( $ this -> date -> plusDays ( $ days ) , $ this -> time -> plusDuration ( $ duration ) ) ; }
Returns a copy of this LocalDateTime with the specific Duration added.

@param Duration $duration

@return LocalDateTime
Returns a copy of this LocalDateTime with the specific Duration added .