Jyxo\Time\Time::plus PHP Method

plus() public method

Returns a new date/time object and adds with the given interval added.
public plus ( integer | string $interval ) : self
$interval integer | string Number of seconds or a string compatible with the strtotime() function
return self
    public function plus($interval) : self
    {
        if (is_numeric($interval)) {
            $interval .= ' seconds';
        }
        $dateTime = clone $this->dateTime;
        $dateTime->modify('+' . (string) $interval);
        return new self($dateTime);
    }