[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] method to parse date time stamp
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|