Home
|
Contact Us
|
Buy Now
|
Add To Favorites
gmdate() example
by pqr ghj
Do not use the "T" timezone specifier to generate "GMT", as this may return "UTC" or "GMT+0000" or "Z" or something else which depends on the running platform, which would not be RFC1123 compliant.
Use 'D, d M Y H:i:s \G\M\T' which forces the value of the timezone indicator.
Note that RFC1123 requires the use of ENGLISH day and month abbreviations. They MUST NOT be localized!
An example of the RFC1123 format for full dates is:
Sun, 06 Nov 1994 08:49:37 GMT
Note the presence of the leading 0 (RFC1123 dates have a fixed size, and space padding is prohibited because it causes problems with fixed size handling when such dates are used in HTTP headers that may compress whitespaces.
Some proxies accept also the ISO 8601 format, but this is not documented in HTTP/1.1 specs (RFC2616).
Examples:
header('Date: '.gmdate('D, d M Y H:i:s \G\M\T', time()));
header('Last-Modified: '.gmdate('D, d M Y H:i:s \G\M\T', time()));
header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + 3600));
or if you prefer double quotes and don't want to bother with double backslashes:
header("Date: ".gmdate("D, d M Y H:i:s", time())." GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s", time())." GMT");;
header("Expires: ".gmdate("D, d M Y H:i:s", time() + 3600)." GMT");
1 Responses
aaa aaa
Posted: Thu 18th Jan 2007
tyieripeori
dfgnmbfm,nb,vmb
login to leave response
Home
::
Overview
::
Benefits
::
Press Reviews
::
Order Now
::
Q & A
::
Writers' Links
::
Published Authors
::
About Us
::
Affiliates
::
Privacy Policy
Book Writing Help
::
Book Writing Program
::
Book Writing Software
::
Child Book Writing
::
Novel Writing Software Download
::
DMOZ Novel Writing Software Directory