get Month Number Map - Java java.util

Java examples for java.util:Month

Description

get Month Number Map

Demo Code


//package com.java2s;
import java.util.HashMap;

public class Main {
    public static void main(String[] argv) throws Exception {
        getMonthNumber();//from  www  .ja  va  2  s .c  o  m
    }

    public static HashMap<String, String> monthNumber;

    private static void getMonthNumber() {
        // TODO Auto-generated method stub
        monthNumber = new HashMap<String, String>();
        monthNumber.put("jan", "01");
        monthNumber.put("feb", "02");
        monthNumber.put("mar", "03");
        monthNumber.put("apr", "04");
        monthNumber.put("may", "05");
        monthNumber.put("jun", "06");
        monthNumber.put("jul", "07");
        monthNumber.put("aug", "08");
        monthNumber.put("sep", "09");
        monthNumber.put("oct", "10");
        monthNumber.put("nov", "11");
        monthNumber.put("dec", "12");
    }
}

Related Tutorials