src/LocalTime.php
public function plusSeconds(int $seconds) : LocalTime
    {
        if ($seconds === 0) {
            return $this;
        }

        $sofd = $this->hour * self::SECONDS_PER_HOUR + $this->minute * self::SECONDS_PER_MINUTE + $this->second;
        $newSofd = (($seconds % self::SECONDS_PER_DAY) + $sofd + self::SECONDS_PER_DAY) % self::SECONDS_PER_DAY;

        if ($sofd === $newSofd) {
            return $this;
        }

        $hour = \intdiv($newSofd, self::SECONDS_PER_HOUR);
        $minute = \intdiv($newSofd, self::SECONDS_PER_MINUTE) % self::MINUTES_PER_HOUR;
        $second = $newSofd % self::SECONDS_PER_MINUTE;

        return new LocalTime($hour, $minute, $second, $this->nano);
    }
public function plusSeconds(int $seconds) : LocalTime
    {
        if ($seconds === 0) {
            return $this;
        }

        $sofd = $this->hour * self::SECONDS_PER_HOUR + $this->minute * self::SECONDS_PER_MINUTE + $this->second;
        $newSofd = (($seconds % self::SECONDS_PER_DAY) + $sofd + self::SECONDS_PER_DAY) % self::SECONDS_PER_DAY;

        if ($sofd === $newSofd) {
            return $this;
        }

        $hour = \intdiv($newSofd, self::SECONDS_PER_HOUR);
        $minute = \intdiv($newSofd, self::SECONDS_PER_MINUTE) % self::MINUTES_PER_HOUR;
        $second = $newSofd % self::SECONDS_PER_MINUTE;

        return new LocalTime($hour, $minute, $second, $this->nano);
    }
public function plusSeconds ( int $ seconds ) : LocalTime { if ( $ seconds === 0 ) { return $ this ; } $ sofd = $ this -> hour * self :: SECONDS_PER_HOUR + $ this -> minute * self :: SECONDS_PER_MINUTE + $ this -> second ; $ newSofd = ( ( $ seconds % self :: SECONDS_PER_DAY ) + $ sofd + self :: SECONDS_PER_DAY ) % self :: SECONDS_PER_DAY ; if ( $ sofd === $ newSofd ) { return $ this ; } $ hour = \ intdiv ( $ newSofd , self :: SECONDS_PER_HOUR ) ; $ minute = \ intdiv ( $ newSofd , self :: SECONDS_PER_MINUTE ) % self :: MINUTES_PER_HOUR ; $ second = $ newSofd % self :: SECONDS_PER_MINUTE ; return new LocalTime ( $ hour , $ minute , $ second , $ this -> nano ) ; }
Returns a copy of this LocalTime with the specified period in seconds added.

@param int $seconds The seconds to add, may be negative.

@return LocalTime A LocalTime based on this time with the seconds added.
Returns a copy of this LocalTime with the specified period in seconds added .