Jump to content

Archived

This topic is now archived and is closed to further replies.

plodos

[SOLVED] <pubDate> RFC-822 date-time problem ?

Recommended Posts

.sql

`rdate` datetime NOT NULL COMMENT 'registration date',

with this input '2009-02-12 04:28:08'

 

<?php
$timestamp = strtotime($opstr['rdate']);
$date = date('D, j M Y H:i:s', $timestamp);	

echo "
<item>
<title>".$opstr['sname']." ".$opstr['year']." - ".$opstr['name']." </title>
<description>".$opstr['city'].", ".$opstr['country']." - ".$opstr['cdate']."</description>
<link>".$opstr['link']."</link>
<pubDate>".$date."</pubDate>
</item>";
?>

 

RSS is not showing the time. I didnt apply the corrent time ?

Validator is giving this error : line 13, column 34: pubDate must be an RFC-822 date-time: Thu, 12 Feb 2009 04:28:08 

Share this post


Link to post
Share on other sites

Just use 'r' as the date() format specifier to get the correct RFC format.

Share this post


Link to post
Share on other sites

I just change the date variable like

 

$date = date("r", strtotime($opstr["rdate"]));

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.