Java Month Number Get getMonthNumberByMonthInitials(String monthInitials)

Here you can find the source of getMonthNumberByMonthInitials(String monthInitials)

Description

get Month Number By Month Initials

License

Open Source License

Declaration

public static int getMonthNumberByMonthInitials(String monthInitials) 

Method Source Code

//package com.java2s;

public class Main {
    public static int getMonthNumberByMonthInitials(String monthInitials) {
        if (monthInitials.equals("Jan"))
            return 1;
        else if (monthInitials.equals("Feb"))
            return 2;
        else if (monthInitials.equals("Mar"))
            return 3;
        else if (monthInitials.equals("Apr"))
            return 4;
        else if (monthInitials.equals("May"))
            return 5;
        else if (monthInitials.equals("Jun"))
            return 6;
        else if (monthInitials.equals("Jul"))
            return 7;
        else if (monthInitials.equals("Aug"))
            return 8;
        else if (monthInitials.equals("Sep"))
            return 9;
        else if (monthInitials.equals("Oct"))
            return 10;
        else if (monthInitials.equals("Nov"))
            return 11;
        else if (monthInitials.equals("Dec"))
            return 12;
        else//  w ww  .j ava 2  s  .  com
            return -1;
    }
}

Related

  1. getInitialsByMonthNumber(String monthNumber)
  2. getMonthDigit(String month)
  3. getMonthIds()
  4. getMonthIndex(String str)
  5. getMonthIndexAsString(String type)
  6. getMonthNumberString(int month)
  7. getMonthNumberString(String sMonth)
  8. getNumberOfRSLILMonth(String month)
  9. getNumByStrMonth(String strMonth)