Java tutorial
//package com.java2s; //License from project: LGPL import java.util.Calendar; public class Main { public static String getCurrentMonth() { Calendar calendar = Calendar.getInstance(); int nMonth = calendar.get(Calendar.MONTH) + 1; if (nMonth < 10) return "0" + Integer.toString(nMonth); else return Integer.toString(nMonth); } }