java.util.Calendar call is returning wrong month?
I am using the following code:java.util.Calendar date=java.util.Calendar.getInstance();int month = date.get(java.util.Calendar.MONTH);The problem is month is returning 7 (July) instead of 8 (August) ?Anyone have any ideas why this is happening?
[293 byte] By [
fagane] at [2007-9-26 4:03:31]

Hi! Look at the docs for Calendar. It states that the month values are zero-based, i.e. January == 0. You'll be safer using defined constants, i.e. Calendar.JANUARY, etc. rather than comparing actual values.Hope this helps!Cheers!
amolk at 2007-6-29 13:01:05 >
