[rules-users] Date equal comparison fails - don't understand why

Wolfgang Laun wolfgang.laun at gmail.com
Thu Feb 10 05:45:18 EST 2011


There is a time zone offset != 0 in the toString-ed date.
-W

2011/2/10 Saloojee, Karim <karim.saloojee at fnb.co.za>

> Hi
>
> I am comparing SimpleAccount( dateAccountOpened == "5-Feb-2011")
> where dateAccountOpened is "Sat Feb 05 00:00:00 GMT+02:00 2011" (if you
> call toString()). The equal comparator fails (==) but the greater than
> comparator passes (>) which I don't understand.
>
> I feel I am missing something obvious here, but I have no idea what it
> is.
>
>
> rule "Test date equality"
>        when
>                $acc : SimpleAccount( dateAccountOpened == "5-Feb-2011")
>
>        then
>                System.out.println("Expected and found an account opened
> on 5-Feb-2011: " + $acc);
> end
>
> rule "Some dates are more equal than others"
>        when
>                $acc : SimpleAccount( dateAccountOpened > "5-Feb-2011")
>
>        then
>                System.out.println("Unexpected match: " +
> $acc.getDateAccountOpened());
> end
>
> Regards,
> Karim
>
> To read FirstRand Bank's Disclaimer for this email click on the following
> address or copy into your Internet browser:
> https://www.fnb.co.za/disclaimer.html
>
> If you are unable to access the Disclaimer, send a blank e-mail to
> firstrandbankdisclaimer at fnb.co.za and we will send you a copy of the
> Disclaimer.
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110210/4db80cf0/attachment.html 


More information about the rules-users mailing list