This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
method to parse date time stamp
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: [xsl] method to parse date time stamp
- From: "Walter Torres" <walter at torres dot ws>
- Date: Wed, 31 Jan 2001 13:23:36 -0600
- Reply-To: xsl-list at lists dot mulberrytech dot com
the date time is created using this format...
<timeStamp>2001-01-31T01:21:35Z</timeStamp>
This is a standard format, I just don't recall the RFC number on it.
After reading the archives of this list and Mr Kays book, I came up with
this solution (see below).
Is there a "better" way to do this?
Looking forward to your opinions...
Thanks
Walter
=================================================
<!-- timestamp NODE Template -->
<xsl:template match='pubdate'>
<td>
<!-- make this value a variable -->
<xsl:variable name='datetime' select='.' />
<!-- Pull the pieces apart -->
<xsl:variable name='year' select='substring( $datetime, 0 , 5 )' />
<xsl:variable name='month' select='substring( $datetime, 6 , 2 )' />
<xsl:variable name='day' select='substring( $datetime, 9 , 2 )' />
<!-- put the date together in American order -->
<xsl:value-of select="concat($month, '/', $day, '/', $year )"/>
<!-- Seperate the date and Time -->
-
<!-- Display the Time -->
<xsl:value-of select='substring( $datetime, 12 , 8 )'/>
</td>
</xsl:template>
=================================================
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list