Android Day in Month Get daysInMonth(int day, int month, int year)

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

Description

days In Month

License

Apache License

Declaration

public static int daysInMonth(int day, int month, int year) 

Method Source Code

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

import java.util.Calendar;

import java.util.GregorianCalendar;

public class Main {
    public static int daysInMonth(int day, int month, int year) {

        return new GregorianCalendar(year, month, day)
                .getActualMaximum(Calendar.DAY_OF_MONTH);

    }//w  w w.  j  a  va2  s .com

    public static int daysInMonth(Calendar c) {

        return daysInMonth(c.get(Calendar.DATE), c.get(Calendar.MONTH),
                c.get(Calendar.YEAR));
    }
}

Related

  1. getDaysInMonth(int month, int year)
  2. getDaysInMonth(int month, int year)
  3. getNextMonthDays(String argDate)
  4. daysInMonth(Calendar c)
  5. getNextMonthDays(String argDate)