Forum Moderators: coopster
I have two values: $date and $time. These would be equivilant to:
$date = "2008-05-31";
$time = "20:39:00";
I have then been joining the two to equal:
$pubdate = "$date $time";
Which equals 2008-05-31 20:39:00.
How do I generate a complete RSS pubdate value from the above values?
Your thanks in advance.
DATE_FORMAT [dev.mysql.com]
Time should be ok as is, just append the time as you are doing.
dc
Tue, Sep 09 2008
I can seem to get out the day value.
Any ideas?
Thanks.
$dateValue = "$date $time";//2008-09-23 06:50:31
$time=strtotime($dateValue);
$pubDate = date('D, d M Y H:i:s',$time);//Tue, 23 Sep 2008 06:50:31
Only issue is that RSS 2.0, to validate requires in my case EST on the end of the string. When I append this, the browser displays the time as if it were two hours earlier, i.e. 7 hours ago instead of 5 hours ago. Any ideas?
Thanks.
putenv("TZ=Australia/Brisbane");
This works when not appending EST to the <pubDate> tag. i.e <pubDate>$pubDate EST</pubDate>
When I add the EST in, it throws it out by 2 hours. If I remove the Putenv line, the date stays the same, so am not sure that is affecting anything. I tried adding +0000 instead of EST, and that does some weird stuff with taking the time backward instead of maintaining it, which I thought it would, because the default is GMT. Any more ideas?