[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

method to parse date time stamp

Subject: method to parse date time stamp
From: "Walter Torres" <walter@xxxxxxxxx>
Date: Wed, 31 Jan 2001 13:23:36 -0600
xsl parse date
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.