Here you can find the source of getMonth(Date d)
public static int getMonth(Date d)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; public class Main { public static int getMonth(Date d) { Calendar c = Calendar.getInstance(); c.setTime(d);/*w w w . j a va 2s.c o m*/ return c.get(Calendar.MONTH) + 1; } public static int getMonth() { return getMonth(new Date()); } }