Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Format date for XML feed of new links

Quote Reply
Format date for XML feed of new links
Hi all

I've setup a Glinks new links XML feed using the PageBuilder plugin, (if you want to know any of the details let me know btw).

Everything is setup correctly except for the lastBuildDate and pubDate per item.

I'm using the last_build var for lastBuildDate and Date_Checked for pubDate, my server is in Canada so I'm attempting to convert those two dates to GMT (subtract 7 hours).

This is as far as I've got:

Code:
<%~ set serverTimeOffset = GT::Date::date_sub($Date_Checked, (60 * 60 * 7))%>
<pubDate><%serverTimeOffset%> GMT</pubDate>

Outputs the correct time for GMT:
<pubDate>2010-04-27 GMT</pubDate>

But when formatting it
Code:
<%~ set serverTimeOffset = GT::Date::date_sub($Date_Checked, (60 * 60 * 7))%>
<pubDate><%GT::Date::date_transform($serverTimeOffset, '%yyyy%-%mm%-%dd% %HH%:%MM%:00', '%ddd%, %dd% %mmm% %yyyy% %HH%:%MM%:00')%> GMT</pubDate>

Outputs:
<pubDate> GMT</pubDate>

And calling date_transform with Date_Checked on it's own does work, just without the time offset.
Code:
<pubDate><%GT::Date::date_transform($Date_Checked, '%yyyy%-%mm%-%dd% %HH%:%MM%:00', '%ddd%, %dd% %mmm% %yyyy% %HH%:%MM%:00')%> GMT</pubDate>

Outputs:
<pubDate>Tue, 27 Apr 2010 05:13:00 GMT</pubDate>

Something obvious I'm missing or an alternative way to do this?

In a few places in the forums I see people referring to the documentation for GT::Date (for example), where are these docs located? Don't seem to be part of the versions of Glinks/ LinksSQL I've ever downloaded.


Thanks

Charlie



Comedy Quotes - Glinks 3.3.0, PageBuilder, StaticURLtr, CAPTCHA, User_Edit_Profile

Subject Author Views Date
Thread Format date for XML feed of new links Chas-a 4190 Apr 27, 2010, 5:13 AM
Thread Re: [Chas-a] Format date for XML feed of new links
Andy 4103 Apr 27, 2010, 7:51 AM
Post Re: [Andy] Format date for XML feed of new links
Chas-a 4094 Apr 27, 2010, 1:35 PM