[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: formatting dates/times in XSL
On Mon, Oct 29 '01 at 22:17, Todd Binder wrote: > Is there a way to format dates and times in XSL? currently I have date and No, but you can easily write one > time elements in the XML sourcefile > > <date>20011011</date> <xsl:template match="date"> <xsl:variable name="month" select="substring(.,5,2)"/> <xsl:value-of select="document('')//my:monthnames/my:month[position()=$month]"/> <xsl:text> </xsl:text> <xsl:value-of select="substring(.,7,2)"/> <xsl:text>, </xsl:text> <xsl:value-of select="substring(.,1,4)"/> </xsl:template> with <my:monthnames> <my:month>Januar</my:month> <my:month>Februar</my:month> <my:month>March</my:month> <!-- ... --> <my:month>December</my:month> </my:monthnames> somewhere in the beginning of your stylesheet > <time>14:00</time> > > and with XSL, I would like to format the date as MMM DD, YYYY (i.e. October > 11, 2001) and format the time in the format of 2 pm I will not tell you how to converte time to this wired american format, as I only support "military" time. (Germany and most of Europa does only use "military" time) -- Goetz Bock IT Consultant Dipl.-Inf. Univ. Attachment:
pgp00022.pgp
|
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
|