(PHP 5 >= 5.2.0, PHP 7)
Representation of date and time.
$format
, string $time
[, DateTimeZone $timezone
] )DateTime::ATOMDATE_ATOMDATE_COOKIEDateTime::ISO8601DATE_ISO8601Note: This format is not compatible with ISO-8601, but is left this way for backward compatibility reasons. Use
DateTime::ATOMorDATE_ATOMfor compatibility with ISO-8601 instead.
DateTime::RFC822DATE_RFC822DateTime::RFC850DATE_RFC850DateTime::RFC1036DATE_RFC1036DateTime::RFC1123DATE_RFC1123DateTime::RFC2822DATE_RFC2822DateTime::RFC3339DATE_RFC3339DATE_ATOM (since PHP 5.1.3)
DateTime::RSSDATE_RSSDateTime::W3CDATE_W3C
| Version | Description |
|---|---|
| 5.5.0 | The class now implements DateTimeInterface. |
| 5.4.24 | The COOKIE constant was changed to reflect RFC 1036 using a four digit year rather than a two digit year (RFC 850) as prior versions. |
| 5.2.2 | DateTime object comparison with the comparison operators changed to work as expected. Previously, all DateTime objects were considered equal (using ==). |