Java Month Number Get getMonthNumberString(String sMonth)

Here you can find the source of getMonthNumberString(String sMonth)

Description

get Month Number String

License

Apache License

Declaration

public static String getMonthNumberString(String sMonth) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static String getMonthNumberString(String sMonth) {
        sMonth = sMonth.toUpperCase(); // ToUpper();
        if (sMonth.startsWith("JAN"))
            return "01";
        if (sMonth.startsWith("FEB"))
            return "02";
        if (sMonth.startsWith("MAR"))
            return "03";
        if (sMonth.startsWith("APR"))
            return "04";
        if (sMonth.startsWith("MAY"))
            return "05";
        if (sMonth.startsWith("JUN"))
            return "06";
        if (sMonth.startsWith("JUL"))
            return "07";
        if (sMonth.startsWith("AUG"))
            return "08";
        if (sMonth.startsWith("SEP"))
            return "09";
        if (sMonth.startsWith("OCT"))
            return "10";
        if (sMonth.startsWith("NOV"))
            return "11";
        if (sMonth.startsWith("DEC"))
            return "12";
        return null;
    }//from  w  w  w  .j  ava  2 s  .  co  m
}

Related

  1. getMonthIds()
  2. getMonthIndex(String str)
  3. getMonthIndexAsString(String type)
  4. getMonthNumberByMonthInitials(String monthInitials)
  5. getMonthNumberString(int month)
  6. getNumberOfRSLILMonth(String month)
  7. getNumByStrMonth(String strMonth)
  8. getNumericMonthEquivalent(String s)
  9. monthAdhToNumber(final String month)