Here you can find the source of getCurrentMonth()
public static int getCurrentMonth()
//package com.java2s; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { private static final Calendar CALENDAR = new GregorianCalendar(); public static int getCurrentMonth() { CALENDAR.setTime(new Date()); return CALENDAR.get(Calendar.MONTH) + 1; }/*from ww w. ja v a 2 s.c o m*/ }