Java Month Get getMonths(DateFormatSymbols symbols)

Here you can find the source of getMonths(DateFormatSymbols symbols)

Description

get Months

License

Apache License

Declaration

public static String[] getMonths(DateFormatSymbols symbols) 

Method Source Code


//package com.java2s;
/*/*from  w  w  w.j  a  v  a  2  s  . co m*/
 * Copyright 2004-2011 the Seasar Foundation and the Others.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */

import java.text.DateFormatSymbols;
import java.util.Calendar;

public class Main {
    public static String[] getMonths(DateFormatSymbols symbols) {
        String[] months = new String[12];
        String[] localeMonths = symbols.getMonths();
        months[0] = localeMonths[Calendar.JANUARY];
        months[1] = localeMonths[Calendar.FEBRUARY];
        months[2] = localeMonths[Calendar.MARCH];
        months[3] = localeMonths[Calendar.APRIL];
        months[4] = localeMonths[Calendar.MAY];
        months[5] = localeMonths[Calendar.JUNE];
        months[6] = localeMonths[Calendar.JULY];
        months[7] = localeMonths[Calendar.AUGUST];
        months[8] = localeMonths[Calendar.SEPTEMBER];
        months[9] = localeMonths[Calendar.OCTOBER];
        months[10] = localeMonths[Calendar.NOVEMBER];
        months[11] = localeMonths[Calendar.DECEMBER];
        return months;
    }
}

Related

  1. getMonthNumber()
  2. getMonthOfSeason(Date date, boolean firstOrLast)
  3. getMonthPath(Date date)
  4. getMonthRange(String strBeginDate, String strEndDate, String pattern)
  5. getMonths()
  6. getMonthSpace(Date date)
  7. getMonthStartTime(int year, int month)
  8. getMonthString(Date date)
  9. getMonthString(int month)