I can't see where I'm going wrong with the code below, its probably something obvious but I'm too blind to see it at this stage. I'm passing a date of "01/01/2009" to an instance of calendar. I then try and set the month to 2 for March and the output I see is
formatted: 01/01/2009
cal month: 2
cal.set( Calendar.MONTH, mth ); //mth = int 2
log.debug("formatted: " + formatter.format(cal.getTime()));
log.debug("cal month: "+Integer.valueOf(cal.get(Calendar.MONTH)).toString());
When I set the Calendar.DAY to the max value the date comes out as 31/01/2009
Why does my setting of the Month not take?