find the number of days in a month

by rajesh 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: 2Cool

Tagged in:

1342
like
0
dislike
0
mail
flag

You must LOGIN to add comments