|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Converting date formats
Others gave the direct way to translate dates. You can also use the XSLT
Standard Library
http://xsltsl.sourceforge.net/ ===== I use it to print events for a calendar. The input is iCalendar converted to XML. ... <DTSTART> <param kind="TZID">CT(America/Chicago)</param> <value>20010609T090000</value> </DTSTART>
<xsl:call-template name="dt:format-date-time">
<xsl:with-param name="year" select='substring($this-date, 1, 4)' />
<xsl:with-param name="month" select='substring($this-date, 5, 2)'/>
<xsl:with-param name="day" select='substring($this-date, 7, 2)'/>
<xsl:with-param name="hour" select='substring($this-date, 10, 2)'/>
<xsl:with-param name="minute" select='substring($this-date, 12, 2)'/>
<xsl:with-param name="second" select='substring($this-date, 14, 2)'/>
<xsl:with-param name="time-zone"></xsl:with-param>
<xsl:with-param name="format" select="'%Y-%m-%dT %H:%M:%S'" />
</xsl:call-template>
</xsl:template>It's overkill if you just want to convert the date. Perhaps you want to format dates in several ways... Gary Hewko, Doug wrote: In my XML document, I have a date stored in ISO format: <LASTUPDATED FORMAT="ISODATE">20010125</LASTUPDATED> 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
|

Cart








