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

3:55a Jan 21st, '11

Unique UGG Boots Sale Australia has been popular for quite a long time for its comfort, performance and style.The best quality boots are made from genuine sheep skin but imitation boots are everywhere. The so-called no good goods cheaper, but when it comes to the

Cheap UGG Classic Mini , keep in mind that you’re getting far more than just good looks,air jordans; you

Related Blog Posts