Here you can find the source of getNumByStrMonth(String strMonth)
public static int getNumByStrMonth(String strMonth)
//package com.java2s; //License from project: Apache License public class Main { public static int getNumByStrMonth(String strMonth) { if (strMonth.equals("January")) { return 1; }/*from w w w . j av a 2 s .co m*/ if (strMonth.equals("February")) { return 2; } if (strMonth.equals("March")) { return 3; } if (strMonth.equals("April")) { return 4; } if (strMonth.equals("May")) { return 5; } if (strMonth.equals("June")) { return 6; } if (strMonth.equals("July")) { return 7; } if (strMonth.equals("August")) { return 8; } if (strMonth.equals("September")) { return 9; } if (strMonth.equals("October")) { return 10; } if (strMonth.equals("November")) { return 11; } if (strMonth.equals("December")) { return 12; } return 0; } }