Here you can find the source of returnMonth(String month)
public static int returnMonth(String month)
//package com.java2s; //License from project: Open Source License public class Main { public static int returnMonth(String month) { if (month.toLowerCase().equals("jan")) { return 0; }//from w w w. ja va2s . c o m if (month.toLowerCase().equals("feb")) { return 1; } if (month.toLowerCase().equals("mar")) { return 2; } if (month.toLowerCase().equals("apr")) { return 3; } if (month.toLowerCase().equals("may")) { return 4; } if (month.toLowerCase().equals("jun")) { return 5; } if (month.toLowerCase().equals("jul")) { return 6; } if (month.toLowerCase().equals("aug")) { return 7; } if (month.toLowerCase().equals("sep")) { return 8; } if (month.toLowerCase().equals("oct")) { return 9; } if (month.toLowerCase().equals("nov")) { return 10; } if (month.toLowerCase().equals("dec")) { return 11; } return -1; } public static String returnMonth(int month) { switch (month) { case 0: return "Jan"; case 1: return "Feb"; case 2: return "Mar"; case 3: return "Apr"; case 4: return "May"; case 5: return "Jun"; case 6: return "Jul"; case 7: return "Aug"; case 8: return "Sep"; case 9: return "Oct"; case 10: return "Nov"; case 11: return "Dec"; } return " "; } }