Another thing, the key for publication date is "published" and not
pudDate. So use:
$feedData = array(
'title' => 'title of the feed',
'link' => 'canonical url to the feed',
'lastUpdate' => mktime(1, 1, 1, 1, 1, 2007),
'charset' => 'utf-8',
'published' => mktime(null, null, null, 1, 1, 2007),
'entries' => array(
array(
'title' => 'title of the feed entry',
'link' => 'url to a feed entry',
'description' => 'short version of a feed entry',
'content' => 'long version',
'lastUpdate' => mktime(null, null, null, 1, 1, 2007),
'published' => mktime(null, null, null, 1, 1, 2007)
)
)
);
$rssFeed = Zend_Feed::importArray($feedData, 'rss');
$rssFeed->send();
Best,
Andries
Andries Seutens schreef:
Hello Bill,
Zend_Feed's date format expects a timestamp format. It will automaticly
convert it to the RFC format. So instead of providing a string date,
provide a timestamp, like so:
$feedData = array(
'title' => 'title of the feed',
'link' => 'canonical url to the feed',
'lastUpdate' => mktime(1, 1, 1, 1, 1, 2007),
'charset' => 'utf-8',
'entries' => array(
array(
'title' => 'title of the feed entry',
'link' => 'url to a feed entry',
'description' => 'short version of a feed entry',
'content' => 'long version',
'lastUpdate' => mktime(null, null, null, 1, 1, 2007)
)
)
);
$rssFeed = Zend_Feed::importArray($feedData, 'rss');
echo $rssFeed;
Best,
Andries
Bill YILDIRIM schreef:
Hi there,
I have been playing with Zend_Feed since yesterday. I finally managed
to create my first rss feed. I have on problem though. This is how I
convert mysql datetime to rss date time
$newstime = $thisProduct->addDate;
list($date, $hours) = split(' ', $newstime);
list($year,$month,$day) = split('-',$date);
list($hour,$min,$sec) = split(':',$hours);
//returns the date ready for the rss feed
$date = date('r',mktime($hour, $min, $sec, $month, $day,
$year)); but when I reach the feed, it shows the current date and time?
does it suppose to work like this?
Thanks
B