Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do I compare two date variables

Status
Not open for further replies.

tburrows

Technical User
Oct 3, 2003
49
US
I have an xml file:
<datatable>
<jmmain_jcourt>
<book_id>199900056</book_id>
<courtdate>09/18/2000</courtdate>
<courttype>S </courttype>
<sysdate>12/16/2003</sysdate>
</jmmain_jcourt>
</datatable>

I want to do a comparison between courtdate and sysdate such as:
<xsl:if test=&quot;courtdate>=sysdate&quot;>

Any ideas? It is not working this way.
Tom
 
I won't say this is causing it, but one thing I noticed is that you're storing your dates as strings. In order to put dates into XML you should be using ISO-8601 (aka RFC-3339) format, which is yyyy-mm-ddThh:nn:ss (plus an optional timezone offset). The &quot;T&quot; is a literal.

Chip H.




If you want to get the best response to a question, please check out FAQ222-2244 first
 
I have no choice about the way the date is stored. I did find a way to compare them. I broke down each date into its three parts (mm,dd,yyyy) and then did a comparison and assigned true of false to a variable depending on the comparison.

tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top