Java Month of Year daysInMonth(int year, int month)

Here you can find the source of daysInMonth(int year, int month)

Description

days In Month

License

Apache License

Declaration

public static int daysInMonth(int year, int month) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static int daysInMonth(int year, int month) {
        //Month in java.util.Calendar is 0-based, so subtract 1:
        java.util.Calendar cal = new java.util.GregorianCalendar(year, month - 1, 1);
        return cal.getActualMaximum(java.util.Calendar.DAY_OF_MONTH);
    }/*from   w  ww. j  a va  2s.  com*/
}

Related

  1. dayOfYear(int year, int month, int day)
  2. daysInMonth(final int month, final int year)
  3. daysInMonth(final int year, final int month)
  4. daysInMonth(int month, int year)
  5. daysInMonth(int month, int year)
  6. daysInMonth(int year, int month)
  7. get_NextSunday_YearMonthDay_integerArray()
  8. getActualMonthBefore(int year, int month, int i)
  9. getCalforMonth(String month, String year)