get Current Month in integer - Android java.util

Android examples for java.util:Month

Description

get Current Month in integer

Demo Code

import android.util.Log;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

public class Main{

    public static int getCurrentMonth() {
        return Calendar.getInstance().get(Calendar.MONTH) + 1; 
    }//from w w  w.  jav a  2s . c o  m

}

Related Tutorials