Java Year Month getMonthDays(Integer year, Integer month)

Here you can find the source of getMonthDays(Integer year, Integer month)

Description

get Month Days

License

Open Source License

Declaration

public static Integer getMonthDays(Integer year, Integer month) 

Method Source Code

//package com.java2s;

import java.util.*;

public class Main {

    public static Integer getMonthDays(Integer year, Integer month) {
        if (year != null && year > 0 && month != null && month > 0) {
            Calendar c = Calendar.getInstance();
            c.set(Calendar.YEAR, year);
            c.set(Calendar.MONTH, month);
            c.set(Calendar.DATE, 1);
            c.add(Calendar.DATE, -1);
            return c.get(Calendar.DATE);
        }//from   w w w .jav a  2  s. c  om
        return 0;
    }
}

Related

  1. getFirstDayByMonthWeek(int year, int month, int week)
  2. getFirstDayOfMonth(int year, int month)
  3. getFirstDayOfMonth(int year, int month, Integer day)
  4. getFirstTimeOfDay(int year, int month, int day)
  5. getFirstYearMonth()
  6. getMonthDays(Integer year, Integer month)
  7. getPerMonthByCuttentYear()
  8. getQuarterToYearMonthDay(Integer year, Integer quarter)
  9. getStartMonth(int year, int month)