change date format from tt_news (displayXML)

483 views Asked by At

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?

1

There are 1 answers

3
Michael On

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?