Here you can find the source of getMonth(Date date)
public static String getMonth(Date date)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getMonth(Date date) { return FormatDate(date, "MM"); }//from w w w . j av a 2s .co m public static String FormatDate(Date date, String sf) { if (date == null) return ""; SimpleDateFormat dateformat = new SimpleDateFormat(sf); return dateformat.format(date); } }