[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: Formatting a date


Subject: Re: Formatting a date
From: "Christopher R. Maden" <crism@xxxxxxxxxx>
Date: Fri, 11 Aug 2000 17:22:03 -0700

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




Current Thread
Keywords
xml