Category archive: rss

September 19, 2007

Formatting date & time for RSS 0

According to the RSS spec, all of the dates in your RSS content should be in RFC 822 format. That means they should look like this:

Sat, 07 Sep 2002 09:42:31 GMT

Here’s a PHP function that will take a timestamp and give you that string:

function rss_time($time){
	return strftime("%a, %d %b %Y %H:%M:%S %z", $time);
}