src/Carbon/CarbonPeriod.php
public function toIso8601String()
    {
        $parts = [];

        if ($this->recurrences !== null) {
            $parts[] = 'R'.$this->recurrences;
        }

        $parts[] = $this->startDate->toIso8601String();

        $parts[] = $this->dateInterval->spec();

        if ($this->endDate !== null) {
            $parts[] = $this->endDate->toIso8601String();
        }

        return implode('/', $parts);
    }
public function toIso8601String()
    {
        $parts = [];

        if ($this->recurrences !== null) {
            $parts[] = 'R'.$this->recurrences;
        }

        $parts[] = $this->startDate->toIso8601String();

        $parts[] = $this->dateInterval->spec();

        if ($this->endDate !== null) {
            $parts[] = $this->endDate->toIso8601String();
        }

        return implode('/', $parts);
    }
public function toIso8601String ( ) { $ parts = [ ] ; if ( $ this -> recurrences !== null ) { $ parts [ ] = 'R' . $ this -> recurrences ; } $ parts [ ] = $ this -> startDate -> toIso8601String ( ) ; $ parts [ ] = $ this -> dateInterval -> spec ( ) ; if ( $ this -> endDate !== null ) { $ parts [ ] = $ this -> endDate -> toIso8601String ( ) ; } return implode ( '/' , $ parts ) ; }
Format the date period as ISO 8601.

@return string
Format the date period as ISO 8601 .