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

Re: sorting by date

Subject: Re: sorting by date
From: Steve.Ball@xxxxxxxxx
Date: Tue, 23 Oct 2001 14:27:45 +1000
tcl date sort
Katie McNally wrote:
> 
> The format of the dates returned in my XML is 17-Dec-2000 07:23:32.  I need
> to display dates as 12/17/00.  I am formatting the dates I display by
> calling the following template:
[...snip...]

The XSLT Standard Library, http://xsltsl.sf.net/, has a date-time
module which includes a template for formatting dates.

> I am displaying the dates in a table.  The table can be sorted by the user
> by clicking on the column titles.  I am able to sort the table for all of
> the non-date columns, but do not know how to sort the table by date.

What it does *not* include is a way of parsing dates.  You have to do
that yourself :-(

Get your dates into ISO format: YYYYMMDDHHMMSS.  For example,
20011023141400
(2:14PM, 23rd October 2001).  The date value can then be treated as an
integer
for sorting purposes.  Use the date module in XSLTSL to get it back into
a human-readable form.

Cheers,
Steve Ball

-- 
Steve Ball            |   XSLT Standard Library   | Training & Seminars
Zveno Pty Ltd         |     Web Tcl Complete      |   XML XSL Schemas
http://www.zveno.com/ |      TclXML TclDOM        | Tcl, Web Development
Steve.Ball@xxxxxxxxx  +---------------------------+---------------------
Ph. +61 2 6242 4099   |   Mobile (0413) 594 462   | Fax +61 2 6242 4099

 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.