I set Today is Feb 28 2014 and i using the code :
cal.add(Calendar.MONTH, 1);
The output is Mar 28 2014
But i want to show Mar 31 2014
what should i do ?
I set Today is Feb 28 2014 and i using the code :
cal.add(Calendar.MONTH, 1);
The output is Mar 28 2014
But i want to show Mar 31 2014
what should i do ?
You can move date to next month, and then set its day to max value for current month
cal.add(Calendar.MONTH, 1);//move date to next month
cal.set(Calendar.DAY_OF_MONTH, cal.getMaximum(Calendar.DAY_OF_MONTH));
//set day to max value for current month