src/LocalDateTime.php
public function withSecond(int $second) : LocalDateTime
    {
        $time = $this->time->withSecond($second);

        if ($time === $this->time) {
            return $this;
        }

        return new LocalDateTime($this->date, $time);
    }
public function withSecond(int $second) : LocalDateTime
    {
        $time = $this->time->withSecond($second);

        if ($time === $this->time) {
            return $this;
        }

        return new LocalDateTime($this->date, $time);
    }
public function withSecond ( int $ second ) : LocalDateTime { $ time = $ this -> time -> withSecond ( $ second ) ; if ( $ time === $ this -> time ) { return $ this ; } return new LocalDateTime ( $ this -> date , $ time ) ; }
Returns a copy of this LocalDateTime with the second-of-minute altered.

@param int $second

@return LocalDateTime

@throws DateTimeException If the second-of-minute if not valid.
Returns a copy of this LocalDateTime with the second - of - minute altered .