Get month value as int - Android java.util

Android examples for java.util:Month

Description

Get month value as int

Demo Code


//package com.java2s;

import java.util.Calendar;

public class Main {
    public static String monthHZ() {
        Calendar calendar = Calendar.getInstance();
        int month = calendar.get(Calendar.MONTH) + 1;
        return month ;
    }//from ww w  . j  a v a  2 s .  c  o  m
}

Related Tutorials