Add date on Calendar

I try to create the code below. today is 7/2/07, but when I -2 days it shows 6/31/07. but there is no such a date. what do I do to make it go to 6/30/07?

Calendar now = Calendar.getInstance();

Calendar calendar;

calendar = (Calendar) now.clone();

//date of calendar is 6/2/07

calendar.add(Calendar.MONTH, 1);

//date of calendar is 7/2/07

calendar.add(Calendar.DAY_OF_YEAR, -2);

//date of calendar is 6/31/07

[462 byte] By [aboostera] at [2007-11-27 9:22:35]
# 1
does this error have anything to do with Calender beginning its month count at 0. In otherwords a Calender object set to today will on this call:System.out.println(calendar.get(Calendar.MONTH));print out "6" for July.
petes1234a at 2007-7-12 22:17:05 > top of Java-index,Java Essentials,New To Java...
# 2
hmm.. that's right. 6 is for July. I didnt know that. thank you. what about Jan? is it 0?
aboostera at 2007-7-12 22:17:05 > top of Java-index,Java Essentials,New To Java...
# 3
> hmm.. that's right. 6 is for July. I didnt know that.> thank you. what about Jan? is it 0?Can you count backwards?
floundera at 2007-7-12 22:17:05 > top of Java-index,Java Essentials,New To Java...
# 4
Do NOT use those numbers. You do not know or care that July is 6. Sun can change it tomorrow to where June is 27 and July is -12.Use SimpleDateFormat for the conversion between the number and a Date object.
jverda at 2007-7-12 22:17:05 > top of Java-index,Java Essentials,New To Java...