Here you can find the source of getMonthName()
public static String getMonthName()
//package com.java2s; //License from project: LGPL import java.util.Calendar; public class Main { /**/* w ww .ja v a 2 s . co m*/ * Get full name of the current month * @return The full name of the current month */ public static String getMonthName() { Calendar cal = Calendar.getInstance(); int month = cal.get(Calendar.MONTH); String strMonth; switch (month) { case Calendar.JANUARY: strMonth = "Jan"; break; case Calendar.FEBRUARY: strMonth = "Feb"; break; case Calendar.MARCH: strMonth = "Mar"; break; case Calendar.APRIL: strMonth = "Apr"; break; case Calendar.MAY: strMonth = "May"; break; case Calendar.JUNE: strMonth = "June"; break; case Calendar.JULY: strMonth = "July"; break; case Calendar.AUGUST: strMonth = "Aug"; break; case Calendar.SEPTEMBER: strMonth = "Sept"; break; case Calendar.OCTOBER: strMonth = "Oct"; break; case Calendar.NOVEMBER: strMonth = "Nov"; break; case Calendar.DECEMBER: strMonth = "Dec"; break; default: strMonth = "ERROR"; break; } return strMonth; } }