Calendar class issue
I have the following line in the code:
int mmNow = Calendar.getInstance().get(Calendar.MONTH);
while debugging, I can see it is set to 9 not 10. How is that possible? Day and year show correct values of 24 and 2010....
System date is set correctly. Here is what I am getting in the shell:
C:\Documents and Settings\>date
The current date is: Sun 10/24/2010
It is to hard for you to read the API Doc? :eek:
"The first month of the year in the Gregorian and Julian calendars is JANUARY which is 0"
Have a look at the Calendar API to see how months are represented. :)
Wow. Would never guess it works like that. Thanks for the tip!