I am using the following code
Calendar cal = Calendar.getInstance();
System.out.println("Before "+cal.getTime());
cal.set(Calendar.MONTH, 01);
System.out.println("After "+cal.getTime());
the output is
Before Thu Jan 31 10:07:34 IST 2013
After Sun Mar 03 10:07:34 IST 2013
for adding +1 to jan is giving mar month. may be it returning correct output if we add 30 days to present date. but i want to show feb month. can any body help me please..
you can see the +1 to set field is adding 30 days date different to your dates(observed from your output.)
if you want months then use the code