List of utility methods to do Month Convert
String | convertCharMonthToDecimal(String month) convert Char Month To Decimal if (month.toLowerCase().indexOf("jan") != -1) return "01"; else if (month.toLowerCase().indexOf("feb") != -1) return "02"; else if (month.toLowerCase().indexOf("mar") != -1) return "03"; else if (month.toLowerCase().indexOf("apr") != -1) return "04"; ... |
String | convertDecimalToCharMonth(int month) convert Decimal To Char Month if (month == 1) return "Jan"; else if (month == 2) return "Feb"; else if (month == 3) return "Mar"; else if (month == 4) return "Apr"; ... |
String | convertMonth(String monthSlashYear) 01/2012 to January 2012 String[] monthYear = monthSlashYear.split("/"); String month = monthYear[0]; String year = monthYear[1]; return getEnMonth(month) + " " + year; |
int | convertMonth(String value) convert Month value = value.trim();
return Integer.parseInt(value);
|
String | convertMonthFromNumber(int month) convert Month From Number if (month < 1) { return "01"; } else if (month >= 1 && month <= 9) { return "0" + month; } else if (month >= 10 && month <= 12) { return "" + month; } else { return "12"; ... |
String | convertMonthStringToInt(String monthString) convert Month String To Int if (monthString.toLowerCase().equals("jan")) { return "01"; } else if (monthString.toLowerCase().equals("feb") || monthString.toLowerCase().equals("fev")) { return "02"; } else if (monthString.toLowerCase().equals("mar")) { return "03"; } else if (monthString.toLowerCase().equals("apr")) { return "04"; ... |
String | ConvertNumToMonth(int mesEntrada) Convert Num To Month String mesSalida = ""; switch (mesEntrada) { case 1: mesSalida = "Enero"; break; case 2: mesSalida = "Febrero"; break; ... |
String | convertToAlphaMonth(final int importIntMonth) Convert a numeric month into an alphabet month. String importStrMonth = null; switch (importIntMonth) { case 1: importStrMonth = "January"; break; case 2: importStrMonth = "February"; break; ... |
String | convertToMonth_long(int month) convert To Montlong switch (month) { case 1: return "January"; case 2: return "February"; case 3: return "March"; case 4: ... |
int | convertToNumericMonth(String importStrMonth) Convert an alphabet month into a numeric month. importStrMonth = safeString(importStrMonth); if (importStrMonth.equals("January")) { return 1; } else if (importStrMonth.equals("February")) { return 2; } else if (importStrMonth.equals("March")) { return 3; } else if (importStrMonth.equals("April")) { ... |