Java Month Name Get getMonthName(String code)

Here you can find the source of getMonthName(String code)

Description

get Month Name

License

Apache License

Declaration

public static String getMonthName(String code) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    private static String OTHER = "UNDEFINED";

    public static String getMonthName(String code) { // Good for Sorting
        if (code.equals("A"))
            return "Jan";
        if (code.equals("B"))
            return "Feb";
        if (code.equals("C"))
            return "Mar";
        if (code.equals("D"))
            return "Apr";
        if (code.equals("E"))
            return "May";
        if (code.equals("F"))
            return "Jun";
        if (code.equals("G"))
            return "Jul";
        if (code.equals("H"))
            return "Aug";
        if (code.equals("I"))
            return "Sep";
        if (code.equals("J"))
            return "Oct";
        if (code.equals("K"))
            return "Nov";
        if (code.equals("L"))
            return "Dec";
        return OTHER;
    }/*from w  w w  . j  ava  2  s  . co m*/
}

Related

  1. getMonthName(Date date)
  2. getMonthName(int index)
  3. getMonthName(int month, Locale locale)
  4. getMonthName(int MonthNumber)
  5. getMonthName(int monthNumber)
  6. getMonthName(String dateString)
  7. getMonthName(String month)
  8. getMonthNames(Locale locale)
  9. getMonthNames(Locale locale)