Java Month Convert convertMonthStringToInt(String monthString)

Here you can find the source of convertMonthStringToInt(String monthString)

Description

convert Month String To Int

License

Open Source License

Declaration

public static String convertMonthStringToInt(String monthString) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String convertMonthStringToInt(String monthString) {
        if (monthString.toLowerCase().equals("jan")) {
            return "01";
        } else if (monthString.toLowerCase().equals("feb") || monthString.toLowerCase().equals("fev")) {
            return "02";
        } else if (monthString.toLowerCase().equals("mar")) {
            return "03";
        } else if (monthString.toLowerCase().equals("apr")) {
            return "04";
        } else if (monthString.toLowerCase().equals("may")) {
            return "05";
        } else if (monthString.toLowerCase().equals("jun")) {
            return "06";
        } else if (monthString.toLowerCase().equals("jul")) {
            return "07";
        } else if (monthString.toLowerCase().equals("aug")) {
            return "08";
        } else if (monthString.toLowerCase().equals("sep")) {
            return "09";
        } else if (monthString.toLowerCase().equals("oct")) {
            return "10";
        } else if (monthString.toLowerCase().equals("nov")) {
            return "11";
        } else if (monthString.toLowerCase().equals("dec")) {
            return "12";
        }//w  w w  . j  a  va  2s  . co m
        return monthString;
    }
}

Related

  1. convertCharMonthToDecimal(String month)
  2. convertDecimalToCharMonth(int month)
  3. convertMonth(String monthSlashYear)
  4. convertMonth(String value)
  5. convertMonthFromNumber(int month)
  6. ConvertNumToMonth(int mesEntrada)
  7. convertToAlphaMonth(final int importIntMonth)
  8. convertToMonth_long(int month)
  9. convertToNumericMonth(String importStrMonth)