get Number Of Days In Month - Android java.util

Android examples for java.util:Month

Description

get Number Of Days In Month

Demo Code


//package com.java2s;
import java.util.Calendar;
import java.util.Date;

public class Main {
    public static int getNumberOfDaysInMonth(Date someDayInMonth) {
        Calendar monthCal = Calendar.getInstance();
        monthCal.setTime(someDayInMonth);
        return monthCal.getActualMaximum(Calendar.DAY_OF_MONTH);
    }/* w  w w  . ja v a2 s  .  com*/
}

Related Tutorials