Here you can find the source of getMonthNumber()
public static String getMonthNumber()
//package com.java2s; //License from project: LGPL import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**// www . ja v a 2 s . c o m * Get the number of the current month * @return The number of the current month */ public static String getMonthNumber() { Date date = new Date(); SimpleDateFormat format = new SimpleDateFormat("MM"); String output = format.format(date); return output; } }