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

Comparing dates and ignoring time zone

Subject: Comparing dates and ignoring time zone
From: "David Murphy" <david@xxxxxxxxxxxxxx>
Date: Wed, 19 Apr 2006 12:27:56 +0100
david murphy
I'd like to compare two dates for equality, where the time zone of one
or other is not considered.

The first date is:

$first = '2006-03-05'

..and the date to compare might be:

$second='2006-03-05T20:00:00.0000000+01:00'

Or

$second='2006-03-05T22:19:43.000Z'

I've tried the following, but it doesn't produce equality:

<xsl:if test="$first = xs:date(xs:dateTime($second))">
...
</xsl:if>

Any ideas?

Thanks, David

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.