There is a time zone offset != 0 in the toString-ed date.<br>-W<br><br><div class="gmail_quote">2011/2/10 Saloojee, Karim <span dir="ltr"><<a href="mailto:karim.saloojee@fnb.co.za">karim.saloojee@fnb.co.za</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi<br>
<br>
I am comparing SimpleAccount( dateAccountOpened == "5-Feb-2011")<br>
where dateAccountOpened is "Sat Feb 05 00:00:00 GMT+02:00 2011" (if you<br>
call toString()). The equal comparator fails (==) but the greater than<br>
comparator passes (>) which I don't understand.<br>
<br>
I feel I am missing something obvious here, but I have no idea what it<br>
is.<br>
<br>
<br>
rule "Test date equality"<br>
when<br>
$acc : SimpleAccount( dateAccountOpened == "5-Feb-2011")<br>
<br>
then<br>
System.out.println("Expected and found an account opened<br>
on 5-Feb-2011: " + $acc);<br>
end<br>
<br>
rule "Some dates are more equal than others"<br>
when<br>
$acc : SimpleAccount( dateAccountOpened > "5-Feb-2011")<br>
<br>
then<br>
System.out.println("Unexpected match: " +<br>
$acc.getDateAccountOpened());<br>
end<br>
<br>
Regards,<br>
Karim<br>
<br>
To read FirstRand Bank's Disclaimer for this email click on the following address or copy into your Internet browser:<br>
<a href="https://www.fnb.co.za/disclaimer.html" target="_blank">https://www.fnb.co.za/disclaimer.html</a><br>
<br>
If you are unable to access the Disclaimer, send a blank e-mail to<br>
<a href="mailto:firstrandbankdisclaimer@fnb.co.za">firstrandbankdisclaimer@fnb.co.za</a> and we will send you a copy of the Disclaimer.<br>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br>