Hi!
I'm consuming an RSS feed from our RAVE alert system in order to display these alerts on our website. I have set it up like so:
Feed page:
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
[[!getFeed? &url=`http://www.getrave.com/rss/tntech/channel3` &tpl=`raveRSS`]]
</rss>
raveRSS chunk:
<item>
<title>[[+title]]</title>
<link>[[+link]]</link>
<description>[[+description]]</description>
<category>[[+category]]</category>
<pubDate>[[+pubdate]]</pubDate>
<guid>[[+guid]]</guid>
<dc:date>[[+dc.date]]</dc:date>
<date_timestamp>[[+date_timestamp]]</date_timestamp>
<time_ago>[[+date_timestamp:date=`%d-%m-%Y`:ago]]</time_ago>
</item>
The trouble is that the "date" output filter is producing the wrong date. The timestamp is 1424065318 which converts to 02/16/2015 @ 5:41am (UTC) and is correct but the date that MODX is giving me is 15-02-2015, which the "ago" filter converts to "1 day, 7 hours ago" (at the time of this writing). I tried changing it to %c but that gave me Sun Feb 15 23:41:58 2015, which the "ago" filter converted to "7 hours ago." This is closer but it's still off by ~5 hours. I had this same trouble with some JavaScript and I discovered it was because I was using the Date object's "get*" functions instead of the "getUTC*" functions. I don't see any way to make such a change in MODX though.
Help?
Thanks!
[ed. note: dwillis210 last edited this post 9 years, 2 months ago.]