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: Sorting date in xsl


If you convert the date into a string of numbers:

Tue, 29 May 2001 22:37:32
to
20010529223732

That creates a sortable value that should work.  Just make sure that you
always have 4 digits for the year and 2 for the month, day, hours, minutes
and seconds - basically always the same number of characters for each time
representation.  Otherwise you will not get a proper sort, ie. dec 29 1980
would be a larger number then may 29 2001 (19,801,229 to 2,001,529 vs.
19,801,229 to 20,010,529).

-----Original Message-----
From: owner-xsl-list@lists.mulberrytech.com
[mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Gitanjali
Sent: Saturday, June 09, 2001 6:39 AM
To: xsl-list@lists.mulberrytech.com
Subject: [xsl] Sorting date in xsl


Can any body tell me how to sort in xsl.  Do I need to conver the following
format to number and then do sorting..

Thanks

Narsu





<root>

<date>Tue, 29 May 2001 22:37:32 -0400</date>

<date>Tue, 25 May 2001 22:37:32 -0400</date>

<date>Tue, 21 May 2001 22:37:32 -0400</date>

<date>Tue, 23 May 2001 22:37:32 -0400</date>

</root>



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


 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]