Android Day in Month Get daysInMonth(Calendar c)

Here you can find the source of daysInMonth(Calendar c)

Description

days In Month

License

Apache License

Declaration

public static int daysInMonth(Calendar c) 

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);

    }//from  w  ww  .j  a va 2  s . c o  m

    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. daysInMonth(int day, int month, int year)
  3. getDaysInMonth(int month, int year)
  4. getNextMonthDays(String argDate)
  5. getNextMonthDays(String argDate)
  6. perMonthDays(Calendar cal)
  7. numDaysToEndOfMonth()
  8. dayNumber(Date date)