xsl-list
[Top] [All Lists]

Re: [xsl] Date compare in XSL

2009-11-19 11:54:16
2009/11/19 Anil Kumar Veeramalli 
<anil(_dot_)v(_at_)frescoinformatics(_dot_)com>:
Hi ,

I have two variables. I want to find out which is greatest date. I am using
XSL1.0

<xsl:variable name="date1" select="01-Jan-2008"></xsl:variable>
<xsl:variable name="date2" select="02-Jan-2009"></xsl:variable>

I could not find any function or documentation to compare the dates.

Please suggest me on this.

In XSLT 1.0, the usual way is to string process the dates into the
form YYYYMMDD, then you can just do straight number comparisons, for
example 20080101 is before 20090102.




-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>