Welcome to WebmasterWorld Guest from 188.8.131.52 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Become a Pro Member
Outputting RFC 822 Compliant Date for RSS Feed itledi msg:3577920 3:16 pm on Feb 18, 2008 (gmt 0) I'm trying to create a RSS feed through a PHP script.
I'm almost done, but I'm having one small problem with my dates.
Using the following code I sometimes get an "Implausible date" error at feedvalidator.org. How can I output a RFC 822 standards complient date?
echo "<pubDate>".date("D, d M Y G:i:s")." GMT</pubDate>";
I'm not sure, but I think my problem is sometimes the time is 00:00:00. Is that not allowed? Is that the problem? Is it fixable?
cameraman msg:3578031 5:47 pm on Feb 18, 2008 (gmt 0)
Have you tried date('r')? 'r' tells date() to output an RFC2822 formatted date. itledi msg:3578608 8:54 am on Feb 19, 2008 (gmt 0)
Thank you, I didn't realize there was a shorter way to write a RFC date.
I'm still getting the implausible date issue. I'm thinking its not because of date format now, but because of my server location.
I get the problems when its early in the morning. The server is seven hours away from GMT, so I'm getting times like "00:00:00 -0700". Is there a way to convert my time, or shift it, so it reports in GMT time? That way, its not minus seven hours that aren't there?
phranque msg:3578638 9:39 am on Feb 19, 2008 (gmt 0)
will date_default_timezone_set [ php.net] do it for you? cameraman msg:3578957 5:24 pm on Feb 19, 2008 (gmt 0)
gmdate() [ php.net], works same as date() but in GMT.