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

RE: Sorting date format

Subject: RE: Sorting date format
From: "V.Ramkumar" <v.ramkumar@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 23 Dec 2008 16:30:43 +0530
RE:  Sorting date format
>>Michael Kay
>It's best to avoid date formats such as d/m/y or m/d/y - better to use the
>ISO date format yyyy-mm-dd. This is supported directly in XSLT 2.0 via the
>data type xs:date. If you're stuck with XSLT 1.0 and/or d/m/y format dates,
>you will have to rearrange them into y/m/d format using a combination of
>concat() and substring() operations, you can then convert 21/02/05 to
>20050221, which you can then sort directly either as a number or as a
>string. So it's something like

><xsl:sort select="concat(substring(.,7,2), substring(.,4,2),
>substring(.,1,2)"/>

I got the expected. Very nice explanation, Thanks a lot Mr. Michael.

Regards,
Ramkumar

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.