current Month and return int - Android java.util

Android examples for java.util:Month

Description

current Month and return int

Demo Code


//package com.java2s;

import java.util.Calendar;

public class Main {
    public static int currentMonth() {
        Calendar c = Calendar.getInstance();
        int month = c.get(Calendar.MONTH) + 1;
        return month;
    }/*from  w w  w.j a v a  2s . c  om*/
}

Related Tutorials