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

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

Description

get Days By Year Month

License

Apache License

Declaration

public static int getDaysByYearMonth(int year, int month) 

Method Source Code

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

import java.util.Calendar;

public class Main {

    public static int getDaysByYearMonth(int year, int month) {
        Calendar a = Calendar.getInstance();
        a.set(Calendar.YEAR, year);
        a.set(Calendar.MONTH, month - 1);
        a.set(Calendar.DATE, 1);//w ww. j a va 2 s . co  m
        a.roll(Calendar.DATE, -1);
        int maxDate = a.get(Calendar.DATE);
        return maxDate;
    }
}

Related

  1. daysInMonth(int year, int month)
  2. daysInMonth(int year, int month)
  3. get_NextSunday_YearMonthDay_integerArray()
  4. getActualMonthBefore(int year, int month, int i)
  5. getCalforMonth(String month, String year)
  6. getDefaultHolidays(int year, int month)
  7. getEndOfMonth(String year, String month)
  8. getFirstMonthOfThisYear()
  9. getFirstTimeOfDay(int year, int month, int day)