0

I'm generating an XML-file from tt_news. Currently the ###NEWS_DATE### marker gives me the date in the following format:

Tue, 27 Aug 2013 09:26:00 +0200

I want to change this to 2013-08-27. How can I do this?

I've searched a bit and found a similar solution. This should work imho for the XML type:

plugin.tt_news {
    displayXML {
        date_stdWrap.strftime = %Y-%m-%d
    }
}

But the date format stays the same. What I'm doing wrong?

testing
  • 19,681
  • 50
  • 236
  • 417

1 Answers1

1

The displayXML can have several different format options. Depending on what you have set there, the format is defined by the standard (like RSS or ATOM). Take a look in the news plugin, there are the following lines:

if ($this->conf['displayXML.']['xmlFormat'] == 'rss2' || $this->conf['displayXML.']['xmlFormat'] == 'rss091') {
    $markerArray['###NEWS_DATE###'] = date('D, d M Y H:i:s O', $row['datetime']);
} elseif ($this->conf['displayXML.']['xmlFormat'] == 'atom03' || $this->conf['displayXML.']['xmlFormat'] == 'atom1') {
    $markerArray['###NEWS_DATE###'] = $this->hObj->getW3cDate($row['datetime']);
}

So by default, you can't change that. Which format do you use and why do you want differ from the standard?

Michael
  • 2,309
  • 1
  • 23
  • 34
  • 1
    I want to use the rss feature of tt_news to create a XML sitemap ... I used the rss2 option with my custom template. So this isn't possible except changing the RSS format? See here http://www.sitemaps.org/protocol.html and here http://www.w3.org/TR/NOTE-datetime – testing Aug 27 '13 at 18:50
  • There are extensions like http://typo3.org/extensions/repository/view/tq_seo that will do all the magic, so no need to code your own. – Michael Aug 27 '13 at 18:53
  • This extension seems a bit like an overkill because I have SEO already managed except of including tt_news articles. This solution would work without external extensions (which rarely get an update) ... But I already installed dd_googlesitemap. Are there more out there? What would I've to change to get my solution working? But currently I think I stay with dd_googlesitemap. – testing Aug 27 '13 at 19:24