get Month from Calendar as String - Android java.util

Android examples for java.util:Month

Description

get Month from Calendar as String

Demo Code


//package com.java2s;

import java.util.Calendar;

public class Main {

    public static String getMonth() {
        Calendar cal = Calendar.getInstance();
        int month = cal.get(Calendar.MONTH) + 1;
        return String.valueOf(month);
    }//from www .  j a v  a 2s  .  c  o  m
}

Related Tutorials