List of utility methods to do Month
int | extractMonthFromDate(String dateString) extract Month From Date int start = dateString.indexOf(".") + 1; int to = dateString.lastIndexOf("."); return Integer.parseInt(dateString.substring(start, to)); |
String | findMonth(String strMonth) Method findMonth. String month = ""; if (strMonth.equals("01")) { month = "January"; } else if (strMonth.equals("02")) { month = "February"; } else if (strMonth.equals("03")) { month = "March"; } else if (strMonth.equals("04")) { ... |
String | fixMonth(int month) fix Month return (month < 10 ? "0" : "") + month; |
String | fixMonth(String m) fix Month String sm = String.valueOf(m); String[] lib = { "0", "" }; sm = lib[sm.length() - 1] + sm; return sm; |
String | getAllowMonth(String startdate, int count) get Allow Month String tempdate = getCurMonthDayStr(startdate); for (int i = 0; i < count; i++) { tempdate = getNextMonthDayStr(tempdate); return tempdate; |
String | getAssignMonth(String date) get Assign Month if (date != null && date.length() >= 6) return date.substring(4, 6); return null; |
String | getCurrDateByMonth(String date) get Curr Date By Month int day = days(Integer.parseInt(date.substring(0, 4)), Integer.parseInt(date.substring(5, 7))); return date + "-" + day; |
int | getEnligthMonth(String en) get Enligth Month int m = 0; en = en.toLowerCase(); if ("january".indexOf(en) != -1) { m = 1; } else if ("february".indexOf(en) != -1) { m = 2; } else if ("march".indexOf(en) != -1) { m = 3; ... |
String | getEnMonth(String month) get En Month if (month.equals("01") || month.equals("1")) { month = "January"; } else if (month.equals("02") || month.equals("2")) { month = "Feburary"; } else if (month.equals("03") || month.equals("3")) { month = "March"; } else if (month.equals("04") || month.equals("4")) { month = "April"; ... |
int | getFirstMonthByQuarter(int month) get First Month By Quarter int quarter = 0; if (month >= 1 && month <= 3) { quarter = 1; if (month >= 4 && month <= 6) { quarter = 4; if (month >= 7 && month <= 9) { ... |