28

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
  • 23,933
  • 14
  • 88
  • 109
Jacek Kwiecień
  • 12,397
  • 20
  • 85
  • 157

1 Answers1

57
Calendar c = Calendar.getInstance();
int monthMaxDays = c.getActualMaximum(Calendar.DAY_OF_MONTH);
4ndrew
  • 15,354
  • 2
  • 27
  • 29