Java examples for java.util:Month
get Current Month
//package com.java2s; import java.util.Calendar; public class Main { public static void main(String[] argv) throws Exception { System.out.println(getCurrentMonth()); }/*from w ww.ja v a2 s . co m*/ public static int getCurrentMonth() { Calendar calendar = Calendar.getInstance(); // month start from 0 to 11 return calendar.get(Calendar.MONTH) + 1; } }