Here you can find the source of getMonthFromMonthName(String name)
static public int getMonthFromMonthName(String name)
//package com.java2s; //License from project: Open Source License public class Main { private static String[] months = new String[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; static public int getMonthFromMonthName(String name) { for (int i = 0; i < 12; i++) { if (months[i].equalsIgnoreCase(name)) { return i; }//from w ww . j av a2 s. c o m } return -1; } }