Loading...

RFC-822 Date Time in PHP

Submitted by: etlgfx
Updated: ; Posted:

Just in case you were wondering. Here's what I came up with to represent an RFC-822 compliant date string in PHP:

date("D, d M Y H:i:s O" [, $timestamp])

Also keep in mind that PHP's built-in DateTime class has several standard date strings as class constants. I haven't been using that class myself yet, but seems like the way to go if you're developing any kind of serious Time Zone sensitive application: http://ca.php.net/manual/en/class.datetime.php

-- Update --

Looks like some of you are also trying to find out how to convert an RFC-822 time string back to a UNIX timestamp. strtotime() works like a charm for this. It even takes your currently set timezone into account and compensates for the timezone offset required in the RFC-822 date. This of course assumes that you correctly set your time zone using php.ini or date_default_timezone_set().

Any other questions? Feel free to leave it in the comments happy emoticon

5:06a Aug 19th, '10

cheap True religion

true religion jeans

true religion sale

True religion

5:07a Aug 19th, '10

[url=http://www.cheap4designerjeans.com/]cheap True religion[/url] [url=http://www.cheap4designerjeans.com/]true religion jeans[/url] [url=http://www.cheap4designerjeans.com/]true religion sale[/url] [url=http://www.cheap4designerjeans.com/]True religion[/url]

http://www.cnautoclave.com/ http://www.verkaufenedhardy.com/ http://www.cheap4designerjeans.com/ http://www.saleuggbootsde.com/

Related Blog Posts