These functions allow you to get the date and time from the server where your PHP scripts are running. You can use these functions to format the date and time in many different ways.
There is no installation needed to use these functions; they are part of the PHP core.
The behavior of the these functions is affected by settings in php.ini. All these parameters are available in PHP version 5 and onwards.
Constant |
Description |
DATE_ATOM |
Atom (example: 2005-08-15T16:13:03+0000) |
DATE_COOKIE |
HTTP Cookies (example: Sun, 14 Aug 2005 16:13:03 UTC) |
DATE_ISO8601 |
ISO-8601 (example: 2005-08-14T16:13:03+0000) |
DATE_RFC822 |
RFC 822 (example: Sun, 14 Aug 2005 16:13:03 UTC) |
DATE_RFC850 |
RFC 850 (example: Sunday, 14-Aug-05 16:13:03 UTC) |
DATE_RFC1036 |
RFC 1036 (example: Sunday, 14-Aug-05 16:13:03 UTC) |
DATE_RFC1123 |
RFC 1123 (example: Sun, 14 Aug 2005 16:13:03 UTC) |
DATE_RFC2822 |
RFC 2822 (Sun, 14 Aug 2005 16:13:03 +0000) |
DATE_RSS |
RSS (Sun, 14 Aug 2005 16:13:03 UTC) |
DATE_W3C |
World Wide Web Consortium (example:
2005-08-14T16:13:03+0000) |
SUNFUNCS_RET_TIMESTAMP |
Timestamp ( Available in 5.1.2 ) |
SUNFUNCS_RET_STRING |
Hours:minutes (example: 08:02) ( Available in 5.1.2 ) |
SUNFUNCS_RET_DOUBLE |
Hours as floating point number (example 8.75)( Available in 5.1.2 ) |