Back to Date class

Method toISO8601

public string
toISO8601
(mixed $local = false)
Gets the date as an ISO 8601 string. IETF RFC 3339 defines the ISO 8601 format and it can be found at the IETF Web site.
Parameters
  • bool $local True to return the date string in the local time zone, false to return it in GMT.
Returns
  • string The date string in ISO 8601 format.
Since
  • 1.7.0
-
  • http://www.ietf.org/rfc/rfc3339.txt
Class: Date
Project: Joomla

Method toISO8601 - Source code

/**
 * Gets the date as an ISO 8601 string.  IETF RFC 3339 defines the ISO 8601 format
 * and it can be found at the IETF Web site.
 *
 * @param   boolean  $local  True to return the date string in the local time zone, false to return it in GMT.
 *
 * @return  string  The date string in ISO 8601 format.
 *
 * @link    http://www.ietf.org/rfc/rfc3339.txt
 * @since   1.7.0
 */
public function toISO8601($local = false)
{
    return $this->format(\DateTimeInterface::RFC3339, $local, false);
}