26

Possible Duplicate:
Find the number of days in a month in Java

I know these are some ways to do it, but I'm having hard time find information how to do it without passing specified date.

I just want to get number of days in a current month, how do I do that?

Stephen Ostermiller
  • 21,408
  • 12
  • 81
  • 104
Jacek Kwiecień
  • 12,045
  • 20
  • 83
  • 148

1 Answers1

53
Calendar c = Calendar.getInstance();
int monthMaxDays = c.getActualMaximum(Calendar.DAY_OF_MONTH);
4ndrew
  • 14,106
  • 2
  • 25
  • 28