get Month Day Number - Android java.util

Android examples for java.util:Month

Description

get Month Day Number

Demo Code


import android.util.Log;
import java.text.DateFormatSymbols;
import java.util.Calendar;
import sun.bob.mcalendarview.CellConfig;
import sun.bob.mcalendarview.vo.DateData;

public class Main{
    public static int getMonthDayNumber(int offset) {
        Calendar calendar = Calendar.getInstance();
        if (offset != 0)
            calendar.add(Calendar.MONTH, offset);
        return calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
    }/*from  w ww. j  a va  2 s .  c  o m*/
}

Related Tutorials