Here you can find the source of stringToMonth(String m)
public static int stringToMonth(String m)
//package com.java2s; /*// w w w .j a va 2s .c o m BeepBeep, an event stream processor Copyright (C) 2008-2017 Sylvain Hall? This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ public class Main { public static int stringToMonth(String m) { if (m.compareTo("Jan") == 0) return 1; if (m.compareTo("Feb") == 0) return 2; if (m.compareTo("Mar") == 0) return 3; if (m.compareTo("Apr") == 0) return 4; if (m.compareTo("May") == 0) return 5; if (m.compareTo("Jun") == 0) return 6; if (m.compareTo("Jul") == 0) return 7; if (m.compareTo("Aug") == 0) return 8; if (m.compareTo("Sep") == 0) return 9; if (m.compareTo("Oct") == 0) return 10; if (m.compareTo("Nov") == 0) return 11; return 12; } }