Here you can find the source of getCurrentMonth()
public static String getCurrentMonth()
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getCurrentMonth() { return getFormatCurrentTime("MM"); }//from w ww . j a v a 2s . c o m public static String getFormatCurrentTime(String format) { return getFormatDateTime(new Date(), format); } public static String getFormatDateTime(Date date, String format) { SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(date); } }