Here you can find the source of monthAlphaToNum(String str)
Parameter | Description |
---|---|
str | month in string |
private static String monthAlphaToNum(String str)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from www . j ava 2 s . co m*/ * Month string to number * @param str month in string * @return month in number */ private static String monthAlphaToNum(String str) { str = str.toLowerCase(); if (str.equals("jan") || str.equals("january")) { return "01"; } else if (str.equals("feb") || str.equals("february")) { return "02"; } else if (str.equals("mar") || str.equals("march")) { return "03"; } else if (str.equals("apr") || str.equals("april")) { return "04"; } else if (str.equals("may")) { return "05"; } else if (str.equals("jun") || str.equals("june")) { return "06"; } else if (str.equals("jul") || str.equals("july")) { return "07"; } else if (str.equals("aug") || str.equals("august")) { return "08"; } else if (str.equals("sep") || str.equals("september")) { return "09"; } else if (str.equals("oct") || str.equals("october")) { return "10"; } else if (str.equals("nov") || str.equals("november")) { return "11"; } else if (str.equals("dec") || str.equals("december")) { return "12"; } return null; } }