Java Month Name Get getMonthName(int index)

Here you can find the source of getMonthName(int index)

Description

get Month Name

License

Apache License

Declaration

public static String getMonthName(int index) 

Method Source Code

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

public class Main {
    /**//from  www .j a  va 2  s .c  o m
     * This method returns the numeric value in string so that further it can be
     * concanated with other value strings like day,hours,min,seconds at the
     * time of getting eraseTime at savingTransaction.
     * 
     * @param month -
     *            String values like "Jan","Feb"....etc.
     * @return String
     */
    private static String[] monthNames = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct",
            "Nov", "Dec" };

    public static String getMonthName(int index) {
        if (index >= 1 && index <= 12) {
            return monthNames[index - 1];
        }
        return "";
    }
}

Related

  1. getMonth(String monthName)
  2. getMonthByName(String monthName)
  3. getMonthFromMonthName(String name)
  4. getMonthName()
  5. getMonthName(Date date)
  6. getMonthName(int month, Locale locale)
  7. getMonthName(int MonthNumber)
  8. getMonthName(int monthNumber)
  9. getMonthName(String code)