Java Month of Year getMonthDays(Object year, Object month)

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

Description

get Month Days

License

Open Source License

Declaration

public static int getMonthDays(Object year, Object month) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Calendar;

public class Main {
    public static int getMonthDays(Object year, Object month) {
        Calendar cal = Calendar.getInstance();
        cal.set(Calendar.YEAR, Integer.parseInt(year.toString()));
        cal.set(Calendar.MONTH, Integer.parseInt((month.toString())) - 1);
        return cal.getActualMaximum(Calendar.DAY_OF_MONTH);
    }/*from w  w w  .  j  a  va 2s.c  o  m*/
}

Related

  1. getLastMonthDate(int date)
  2. getLastMonthOfQuater(Date date)
  3. getLastMonthOfYear()
  4. getMaxDayOfMonth(int year, int month)
  5. getMonth(int week, int year)
  6. getMonthHaveDays(int year, int month)
  7. getMonthOfYear(int m)
  8. getMonthOfYear(long time)
  9. getMonthOfYearFromTimestamp(long ms)