Here you can find the source of getMonthNumber()
public static String getMonthNumber()
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static String getMonthNumber() { Calendar calendar = new GregorianCalendar(); int m = calendar.get(GregorianCalendar.MONTH); String month = new Integer(m + 1).toString(); if (month.length() < 2) month = "0" + month; return month; }//w w w .j av a 2 s . c om }