Here you can find the source of getMonthOfThisYear(Date currentdate)
public static int getMonthOfThisYear(Date currentdate)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static int getMonthOfThisYear(Date currentdate) { Calendar cal = Calendar.getInstance(); if (currentdate != null) { cal.setTime(currentdate);/* ww w . j ava 2 s .c o m*/ } else { cal.setTime(new Date()); } return cal.get(Calendar.MONTH) + 1; } }