Here you can find the source of getMonth(java.util.Date date)
public static int getMonth(java.util.Date date)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; public class Main { public static int getMonth(java.util.Date date) { java.util.Calendar c = java.util.Calendar.getInstance(); c.setTime(date);//from w w w.ja v a2s .com return c.get(java.util.Calendar.MONTH) + 1; } public static String getMonth() { Calendar calendar = Calendar.getInstance(); String month = String.valueOf(calendar.get(Calendar.MONTH) + 1); if (month.length() == 1) { month = "0" + month; } return month; } }