#101: RSS pubDate uses invalid date-time format
--------------------------------------+-------------------------------------
Reporter: mattblanchette | Owner: geonetwork-devel@lists.sourceforge.net
Type: defect | Status: new
Priority: major | Milestone:
Component: General | Version: v2.2.0 Final
Keywords: RSS, pubDate, date, time |
--------------------------------------+-------------------------------------
RSS generated by rss-utils.xsl contains pubDate with invalid date-time
format yyyy-MM-ddTHH:mm:ss.
This causes timestamps to be incorrect for different timezones.
The RSS pubDate should follow the RFC-822 Date and Time specifications (dd
mm yy hh:mm:ss zzz), so the format "2009-04-21T00:00:01" would be "21 Apr
2009 00:00:01 EST", with the zone value depending on the appropriate
timezone.
Here is my workaround for rss-utils.xsl:
Before:[[BR]]
<pubDate><xsl:value-of select="geonet:info/changeDate"/></pubDate>
After:[[BR]]
<xsl:variable name="date" select="geonet:info/changeDate"/>[[BR]]
<xsl:variable name="day" select="substring($date,9,2)" />[[BR]]
<xsl:variable name="monthnumber" select="substring($date,6,2)" />[[BR]]
<xsl:variable name="year" select="substring($date,1,4)" />[[BR]]
<xsl:variable name="time" select="substring($date,12)" />[[BR]]
<xsl:variable name="month">[[BR]]
<xsl:choose>[[BR]]
<xsl:when test="$monthnumber='01'">[[BR]]
<xsl:value-of select="'Jan'" />[[BR]]
</xsl:when>[[BR]]
<xsl:when test="$monthnumber='02'">[[BR]]
<xsl:value-of select="'Feb'" />[[BR]]
</xsl:when>[[BR]]
<xsl:when test="$monthnumber='03'">[[BR]]
<xsl:value-of select="'Mar'" />[[BR]]
</xsl:when>[[BR]]
<xsl:when test="$monthnumber='04'">[[BR]]
<xsl:value-of select="'Apr'" />[[BR]]
</xsl:when>[[BR]]
<xsl:when test="$monthnumber='05'">[[BR]]
<xsl:value-of select="'May'" />[[BR]]
</xsl:when>[[BR]]
<xsl:when test="$monthnumber='06'">[[BR]]
<xsl:value-of select="'Jun'" />[[BR]]
</xsl:when>[[BR]]
<xsl:when test="$monthnumber='07'">[[BR]]
<xsl:value-of select="'Jul'" />[[BR]]
</xsl:when>[[BR]]
<xsl:when test="$monthnumber='08'">[[BR]]
<xsl:value-of select="'Aug'" />[[BR]]
</xsl:when>[[BR]]
<xsl:when test="$monthnumber='09'">[[BR]]
<xsl:value-of select="'Sep'" />[[BR]]
</xsl:when>[[BR]]
<xsl:when test="$monthnumber='10'">[[BR]]
<xsl:value-of select="'Oct'" />[[BR]]
</xsl:when>[[BR]]
<xsl:when test="$monthnumber='11'">[[BR]]
<xsl:value-of select="'Nov'" />[[BR]]
</xsl:when>[[BR]]
<xsl:otherwise>[[BR]]
<xsl:value-of select="'Dec'" />[[BR]]
</xsl:otherwise>[[BR]]
</xsl:choose>[[BR]]
</xsl:variable>
<pubDate><xsl:value-of select="concat($day,' ',$month,' ',$year,'
',$time,' EST'))"/></pubDate>
--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/101>
GeoNetwork opensource Developer website <http://trac.osgeo.org/geonetwork>
GeoNetwork opensource is a standards based, Free and Open Source catalog application to manage spatially referenced resources through the web. It provides powerful metadata editing and search functions as well as an embedded interactive web map viewer. This website contains information related to the development of the software.