Here you can find the source of getMonth(String sMonth)
public static String getMonth(String sMonth)
//package com.java2s; /*/*www.j a v a 2 s .co m*/ * 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. */ public class Main { public static String getMonth(String sMonth) { String sMonthLC = sMonth.toLowerCase(); if (sMonthLC.startsWith("jan") || sMonthLC.startsWith("ge")) return "01"; if (sMonthLC.startsWith("f")) return "02"; if (sMonthLC.startsWith("mar")) return "03"; if (sMonthLC.startsWith("ap")) return "04"; if (sMonthLC.startsWith("may") || sMonthLC.startsWith("mag")) return "05"; if (sMonthLC.startsWith("jun") || sMonthLC.startsWith("gi")) return "06"; if (sMonthLC.startsWith("jul") || sMonthLC.startsWith("lu")) return "07"; if (sMonthLC.startsWith("au") || sMonthLC.startsWith("ag")) return "08"; if (sMonthLC.startsWith("s")) return "09"; if (sMonthLC.startsWith("o")) return "10"; if (sMonthLC.startsWith("n")) return "11"; if (sMonthLC.startsWith("d")) return "12"; return null; } }