Here you can find the source of getMonthByName(String monthName)
Parameter | Description |
---|---|
monthName | a parameter |
public static int getMonthByName(String monthName)
//package com.java2s; //License from project: Apache License public class Main { public final static String[] MONTHS = new String[] { "january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december" }; /**/*from w w w .java2 s. c o m*/ * Get the Month by Name * * @param monthName * @return */ public static int getMonthByName(String monthName) { // fiscalStartsList = null; for (int i = 0; i < MONTHS.length; i++) { if (monthName.toLowerCase().equals(MONTHS[i])) { return i; } } return 0; } }