Java Utililty Methods Month Name Get

List of utility methods to do Month Name Get

Description

The list of methods to do Month Name Get are organized into topic(s).

Method

ThreadcreateDaemonThread(Runnable runnable, String threadName)
Creates a daemon thread.
Thread daemonThread = new Thread(runnable, threadName);
daemonThread.setDaemon(true);
return daemonThread;
StringgetDutchMonthName(int monthNumber)
Return the (Dutch) month name
if (monthNumber < 1 || monthNumber > 12)
    throw new RuntimeException("Invalid month number " + monthNumber + " (must be 1-12)");
return dutchMonthNames[monthNumber - 1];
StringgetMonth(boolean name)
Returns either the name or the month number depending on the name parameter specified.
if (mCalendar == null)
    Init();
if (name)
    return months[mCalendar.get(Calendar.MONTH)];
else {
    String retVal = null;
    int val = mCalendar.get(Calendar.MONTH) + 1;
    if (val < 10)
...
intgetMonth(String monthName)
Returns the index of month name provided.
String[] months = getMonths();
int month = 0;
for (int i = 0; i < months.length; i++) {
    if (monthName.equals(months[i])) {
        month = i;
return month;
...
intgetMonthByName(String monthName)
Get the Month by Name
for (int i = 0; i < MONTHS.length; i++) {
    if (monthName.toLowerCase().equals(MONTHS[i])) {
        return i;
return 0;
intgetMonthFromMonthName(String name)
get Month From Month Name
for (int i = 0; i < 12; i++) {
    if (months[i].equalsIgnoreCase(name)) {
        return i;
return -1;
StringgetMonthName()
Get full name of the current month
Calendar cal = Calendar.getInstance();
int month = cal.get(Calendar.MONTH);
String strMonth;
switch (month) {
case Calendar.JANUARY:
    strMonth = "Jan";
    break;
case Calendar.FEBRUARY:
...
StringgetMonthName(Date date)
get Month Name
return new SimpleDateFormat("MMMM").format(date);
StringgetMonthName(int index)
get Month Name
if (index >= 1 && index <= 12) {
    return monthNames[index - 1];
return "";
StringgetMonthName(int month, Locale locale)
get Month Name
DateFormatSymbols dateFormatSymbols = new DateFormatSymbols(locale);
return dateFormatSymbols.getMonths()[month];