Android Month String Get getMonthNames()

Here you can find the source of getMonthNames()

Description

get Month Names

Declaration

public static String[] getMonthNames() 

Method Source Code

//package com.java2s;
import static java.util.Calendar.*;
import java.text.DateFormatSymbols;

import java.util.Locale;

public class Main {
    public static String[] getMonthNames(Locale l, int len) {

        String[] s;/*from   w  w  w. j  a  v  a2s  .  c o  m*/
        if (len == SHORT)
            s = new DateFormatSymbols(l).getShortMonths();
        else
            s = new DateFormatSymbols(l).getMonths();

        return s;
    }

    public static String[] getMonthNames() {
        return getMonthNames(Locale.getDefault(), LONG);
    }

    public static String[] getShortMonths() {
        return getMonthNames(Locale.getDefault(), SHORT);
    }
}

Related

  1. getMonthBefore(String format)
  2. getMonthString(int month, int abbrev)
  3. getMonthStringByIndex(int index)
  4. getReadableMonth(int month)
  5. getCurrentMonth()
  6. getMonthNames(Locale l, int len)
  7. getShortMonths()
  8. getShortMonthString(int month)
  9. getLongMonthString(int month)