get Max Days Of Month - Android java.util

Android examples for java.util:Day

Description

get Max Days Of Month

Demo Code

import android.content.Context;
import androidwheelview.dusunboy.github.com.library.R;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

public class Main{

    public static int getMaxDaysOfMonth(int currentYear, int currentMonth) {
        Calendar calendar = Calendar.getInstance();
        calendar.set(currentYear, currentMonth, 1);
        return calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
    }//from   w  ww . jav  a 2 s .  co  m

}

Related Tutorials