get Now Month - Java java.util

Java examples for java.util:Month

Description

get Now Month

Demo Code


//package com.java2s;

import java.util.Calendar;

public class Main {
    public static void main(String[] argv) throws Exception {
        System.out.println(getNowMonth());
    }/*from   w  w  w .  ja  v  a 2  s  . c  o m*/

    public static int getNowMonth() {
        return Calendar.getInstance().get(Calendar.MONTH) + 1;
    }
}

Related Tutorials