xsl-list
[Top] [All Lists]

RE: [xsl] Testing / Comparing dates

2006-03-24 04:24:47
I had to do a similar thing in the past (compare today's day with a stored 
date) and found http://www.exslt.org/date/index.html. There's a list of 
templates there you can use to do date manipulation. The date I used were in 
YYYY-MM-DDTHH:MM:SS format though, although you could easily add on 'T00:00:00' 
if it needs it.

I had a problem on my live site when I was testing it though and needed to make 
a small change to one of the templates. If you find something's not working you 
might want to use my altered template (you can find it here 
http://www.biglist.com/lists/xsl-list/archives/200602/msg00544.html)

Hope this helps

Andy
-----Original Message-----
From: Aaron Johnson [mailto:Aaron2(_dot_)Johnson(_at_)uwe(_dot_)ac(_dot_)uk] 
Sent: 24 March 2006 11:00
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Testing / Comparing dates

Hello...

I have some xml:

<submissionDeadline>2006-17-12</submissionDeadline>

I would like to test this element against a parameter containing the current
date so as to display two lists, a list of items on time and a list of items
that are late.

As far as I am aware, the parameter will be the same format.

I thought if the dates were passed as integers [20061712] it may be possible
to do a greater than of less than test.

Can you compare dates as they are in this form, and if so, how?

Thanks for your advice...

..................................................................

Aaron Johnson
GUI / XSLT development
Academic Technologies Group [ATG]
University of the West of England
0117 3281051 [ext: 81051]
atg.uwe.ac.uk/aaron

SECURITY POLICY:

Please note that ATG will only accept
e-mail attachments in the following
formats: 

.asp,.bin,.doc,.gif,.html,.jpg,.mdb,.png,
.psd,.shtml,.sdf,.sit,.xls,.xml,.xsd,.xsl,.zip,

..................................................................

³In a wireless world without boundaries...
...who needs Gates and Windows?²

..................................................................

This communication is intended solely
for the use of the individual(s) to whom
it is addressed. Any opinions presented
are those of the author and do not
necessarily represent the University of
the West of England, Bristol.
..................................................................



This email has been independently scanned for viruses and any virus software 
has been removed using McAfee anti-virus software

--~------------------------------------------------------------------
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>
--~--


--~------------------------------------------------------------------
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>