Android examples for java.util:Month
get Month value in MM format
import android.content.Context; import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main{ public static int getMM() { SimpleDateFormat sdf = new SimpleDateFormat("mm"); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); return Integer.parseInt(sdf.format(new Date())); }//from w w w.j a v a 2 s . c om }