Back to Date class

Method toRFC822

public string
toRFC822
(mixed $local = false)
Gets the date as an RFC 822 string. IETF RFC 2822 supercedes RFC 822 and its definition 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 RFC 822 format.
Since
  • 1.7.0
-
  • http://www.ietf.org/rfc/rfc2822.txt
Class: Date
Project: Joomla

Method toRFC822 - Source code

/**
 * Gets the date as an RFC 822 string.  IETF RFC 2822 supercedes RFC 822 and its definition
 * 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 RFC 822 format.
 *
 * @link    http://www.ietf.org/rfc/rfc2822.txt
 * @since   1.7.0
 */
public function toRFC822($local = false)
{
    return $this->format(\DateTimeInterface::RFC2822, $local, false);
}