Swat/SwatDate.php
public function getISO8601($options = 5)
    {
        if (($options & self::ISO_EXTENDED) === self::ISO_EXTENDED) {
            $format = self::DF_ISO_8601_EXTENDED;
        } else {
            $format = self::DF_ISO_8601_BASIC;
        }

        if (($options & self::ISO_MICROTIME) === self::ISO_MICROTIME) {
            $format .= '.SSSS';
        }

        $date = $this->format($format);

        if (($options & self::ISO_TIME_ZONE) === self::ISO_TIME_ZONE) {
            $date .= $this->getFormattedOffsetById($format);
        }

        return $date;
    }
public function getISO8601($options = 5)
    {
        if (($options & self::ISO_EXTENDED) === self::ISO_EXTENDED) {
            $format = self::DF_ISO_8601_EXTENDED;
        } else {
            $format = self::DF_ISO_8601_BASIC;
        }

        if (($options & self::ISO_MICROTIME) === self::ISO_MICROTIME) {
            $format .= '.SSSS';
        }

        $date = $this->format($format);

        if (($options & self::ISO_TIME_ZONE) === self::ISO_TIME_ZONE) {
            $date .= $this->getFormattedOffsetById($format);
        }

        return $date;
    }
public function getISO8601 ( $ options = 5 ) { if ( ( $ options & self :: ISO_EXTENDED ) === self :: ISO_EXTENDED ) { $ format = self :: DF_ISO_8601_EXTENDED ; } else { $ format = self :: DF_ISO_8601_BASIC ; } if ( ( $ options & self :: ISO_MICROTIME ) === self :: ISO_MICROTIME ) { $ format .= '.SSSS' ; } $ date = $ this -> format ( $ format ) ; if ( ( $ options & self :: ISO_TIME_ZONE ) === self :: ISO_TIME_ZONE ) { $ date .= $ this -> getFormattedOffsetById ( $ format ) ; } return $ date ; }
Gets this date formatted as an ISO 8601 timestamp

Options are:

- <kbd>{@link SwatDate::ISO_EXTENDED}</kbd>  - include '-' and ':'
separators.
- <kbd>{@link SwatDate::ISO_MICROTIME}</kbd> - include microseconds.
- <kbd>{@link SwatDate::ISO_TIME_ZONE}</kbd> - include time zone.

@param integer $options optional. A bitwise combination of options.
Options include the SwatDate::ISO_* constants.
Default options are to use extended formatting
and to include time zone offset.

@return string this date formatted as an ISO 8601 timestamp.
Gets this date formatted as an ISO 8601 timestamp