public static int getDaysOfMonth(String year, String month) {
        int days = 0;
        if (month.equals("1")
            || month.equals("3")
            || month.equals("5")
            || month.equals("7")
            || month.equals("8")
            || month.equals("10")
            || month.equals("12")) {
            days = 31;
        } else if (month.equals("4")
                   || month.equals("6")
                   || month.equals("9")
                   || month.equals("11")) {
            days = 30;
        } else {
            if ((Integer.parseInt(year) % 4 == 0 && Integer.parseInt(year) % 100 != 0)
                || Integer.parseInt(year) % 400 == 0) {
                days = 29;
            } else {
                days = 28;
            }
        }
        return days;
    }
public static int getDaysOfMonth(String year, String month) {
        int days = 0;
        if (month.equals("1")
            || month.equals("3")
            || month.equals("5")
            || month.equals("7")
            || month.equals("8")
            || month.equals("10")
            || month.equals("12")) {
            days = 31;
        } else if (month.equals("4")
                   || month.equals("6")
                   || month.equals("9")
                   || month.equals("11")) {
            days = 30;
        } else {
            if ((Integer.parseInt(year) % 4 == 0 && Integer.parseInt(year) % 100 != 0)
                || Integer.parseInt(year) % 400 == 0) {
                days = 29;
            } else {
                days = 28;
            }
        }
        return days;
    }
public static int getDaysOfMonth ( String year , String month ) { int days = 0 ; if ( month . equals ( "1" ) || month . equals ( "3" ) || month . equals ( "5" ) || month . equals ( "7" ) || month . equals ( "8" ) || month . equals ( "10" ) || month . equals ( "12" ) ) { days = 31 ; } else if ( month . equals ( "4" ) || month . equals ( "6" ) || month . equals ( "9" ) || month . equals ( "11" ) ) { days = 30 ; } else { if ( ( Integer . parseInt ( year ) % 4 == 0 && Integer . parseInt ( year ) % 100 != 0 ) || Integer . parseInt ( year ) % 400 == 0 ) { days = 29 ; } else { days = 28 ; } } return days ; }
获得某月的天数

@param year
年
@param month
月
@return int 指定年月的天数
获得某月的天数