This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Formatting a date


At 18:38 11-08-2000 -0400, Heather Lindsay wrote:
>         A little efficiency question for you.
>         I have a date which is in the form of "CCYYMMDD.HHMMSS" and I'm
>formatting this date to look like this: "MM/DD/YYYY HH:MM:SS GMT".  I have
>my own way of doing this but I suspect that there is a better way.  Can
>anyone tell me if there is?  I tried format-number() originally but it
>choked on the ":".  What I'm doing now works but isn't very pretty.  Code
>below.

An excuse to publish!  I wrote some ISO 8601 parsing code as part of an 
invoice generator.  Naturally, I got it good enough for me, and then was 
waiting to properly document it before sharing it, and never got around to 
it.  I'll post a URL shortly.

The code won't handle CCYYMMDD.HHMMSS exactly, but it handles 
YYYY-MM-DDTHH:MM:SS (and subsets thereof), and should be applicable 
(replace substring-before() calls with substring() and appropriate parameters).

-Chris
--
Christopher R. Maden, Senior XML Analyst, Lexica LLC
222 Kearny St., Ste. 202, San Francisco, CA 94108-4510
+1.415.901.3631 tel./+1.415.477.3619 fax
<URL:http://www.lexica.net/> <URL:http://www.oreilly.com/%7Ecrism/>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]