Here you can find the source of getMonth(Date date)
public static int getMonth(Date date)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static int getMonth(Date date) { return getCalendar(date).get(2); }/* w w w . jav a 2 s .co m*/ public static Calendar getCalendar(Date day) { Calendar c = Calendar.getInstance(); if (day != null) c.setTime(day); return c; } }