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">&lt;<a href="mailto:karim.saloojee@fnb.co.za">karim.saloojee@fnb.co.za</a>&gt;</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 == &quot;5-Feb-2011&quot;)<br>
where dateAccountOpened is &quot;Sat Feb 05 00:00:00 GMT+02:00 2011&quot; (if you<br>
call toString()). The equal comparator fails (==) but the greater than<br>
comparator passes (&gt;) which I don&#39;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 &quot;Test date equality&quot;<br>
        when<br>
                $acc : SimpleAccount( dateAccountOpened == &quot;5-Feb-2011&quot;)<br>
<br>
        then<br>
                System.out.println(&quot;Expected and found an account opened<br>
on 5-Feb-2011: &quot; + $acc);<br>
end<br>
<br>
rule &quot;Some dates are more equal than others&quot;<br>
        when<br>
                $acc : SimpleAccount( dateAccountOpened &gt; &quot;5-Feb-2011&quot;)<br>
<br>
        then<br>
                System.out.println(&quot;Unexpected match: &quot; +<br>
$acc.getDateAccountOpened());<br>
end<br>
<br>
Regards,<br>
Karim<br>
<br>
To read FirstRand Bank&#39;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>