find the number of days in a month
by rajesh[ Edit ] 2009-12-30 16:10:24
find the number of days in a month.
// Create a calendar object of the desired month
Calendar cal = new GregorianCalendar(2009, Calendar.FEBRUARY, 1);
// Get the number of days in that month
int days = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
This will return the total number of days in the month (example: 2