I'm having trouble getting the date of my RSS Feed to run correctly. Do you know what the proper date to show it is?
I have it stored in a field called creation_date in this format: 2012-08-14 10:17:12
Then i grab it:
$pubDate = $article[creation_date];
Then I convert it:
$pubDate= date("Y-m-d", strtotime($pubDate));
Then within my item tag I place it:
<pubdate>'.date("l, F d, Y", strtotime($pubDate)).'</pubdate>
Is there something that I'm not seeing?
RSS is a Web content syndication format. Its name is an acronym for Really Simple Syndication. RSS is a dialect of XML. All RSS files must conform to the XML 1.0 specification, as published on the World Wide Web Consortium (W3C) website.
XML. RSS is a family of web feed formats used to publish frequently updated pages, such as blogs or news feeds. Really Simple Syndication (RSS 2.0) Rich Site Summary (RSS 0.91, RSS 1.0)
Name. PubDate -- The date of publication of a document.
Section 1: RSS 2.0 Based on the RSS 2.0 specification, there are 3 predefined elements at the item level: title, link, and description. Although these elements are optional in the RSS 2.0 standard, product data feeds require them. Product data feeds also require additional elements such as price, ID, and condition.
The PHP date function has already a way to format pubDate (RFC 2822) compliant dates:
date('r', $timestamp);
Solved:
$pubDate = $article[creation_date]; $pubDate= date("D, d M Y H:i:s T", strtotime($pubDate));
then in my echo'd code:
<pubDate>'.$pubDate.'</pubDate>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With