Here you can find the source of getMonth(Date date)
public static Integer getMonth(Date date)
//package com.java2s; //License from project: Apache License import java.sql.Date; import java.util.Calendar; import java.util.GregorianCalendar; public class Main { public static Integer getMonth(Date date) { return initCalendar(date).get(Calendar.MONTH) + 1; }/*from w ww . jav a 2 s . c om*/ private static Calendar initCalendar(Date date) { Calendar calendar = new GregorianCalendar(); calendar.setTime(date); return calendar; } }