This discussion is archived
2 Replies Latest reply: Oct 6, 2006 2:24 PM by 3004 RSS

date.roll and date.add

807598 Newbie
Currently Being Moderated
Hello

when I use

Calendar cal = Calendar.geInstance();
cal.add(Calendar.DATE, -90);
I can get what I want (roll back 90 days).

But when I use

Calendar cal = Calendar.geInstance();
cal.roll(Calendar.DATE, -90)

I get then "now" plus three more days

When I see Java API, I did not see the different between two functions(add and roll). Could you help me to know when to use roll and when to use add functions

Thank you
shoa