Zend_Feed and changing the date


Just a quick note that will hopefully save someone a bit of time in the future…

When using Zend_Feed to create your RSS, don’t use:

pubDate => date('r', $item->timestamp)

This doesn’t work as you’d expect. You’ll only ever get the current time. If you want to change the date and time use:

latestDate => $item->timestamp

Zend_Feed expects a plain timestamp, not a RFC-822 format date (Fri, 09 Jul 2010 22:20:00 GMT). Why it takes the key as latestDate but outputs pubDate is beyond me…

Topics: Development Tags: , , , ,
Comments: none so far

Post a Comment

Your email is never shared. Required fields are marked *

*
*
Brighton