List of utility methods to do Month Get
int | getIntervalMonths(String startDate, String endDate) get Interval Months startDate = startDate.replaceAll("-", ""); StringBuffer sb = new StringBuffer(startDate); sb.insert(4, "-"); startDate = startDate.length() == 6 ? sb.append("-01").toString() : sb.insert(7, "-").toString(); endDate = endDate.replaceAll("-", ""); StringBuffer sb1 = new StringBuffer(endDate); sb1.insert(4, "-"); endDate = endDate.length() == 6 ? sb1.append("-01").toString() : sb1.insert(7, "-").toString(); ... |
int | getIntevalMonth(String strDate1, String strDate2) get Inteval Month int iMonth = 0; int flag = 0; try { Calendar objCalendarDate1 = Calendar.getInstance(); objCalendarDate1.setTime(DateFormat.getDateInstance().parse(strDate1)); Calendar objCalendarDate2 = Calendar.getInstance(); objCalendarDate2.setTime(DateFormat.getDateInstance().parse(strDate2)); if (objCalendarDate2.equals(objCalendarDate1)) ... |
String | getMonth() get Month Calendar c = getCurCalendar(); return "" + (c.get(Calendar.MONTH) + 1); |
String | getMonth() get Month return format(getCurrDate(), MM);
|
String | getMonth() get Month Calendar cal = Calendar.getInstance(); return new DecimalFormat("00").format(cal.get(Calendar.MONTH)); |
int | getMonth() get Month Calendar calendar = Calendar.getInstance();
return calendar.get(Calendar.MONTH) + 1;
|
String | getMonth() get Month return format(getCurrDate(), MM);
|
String | getMonth() get Month Date date = new Date(); SimpleDateFormat formatter; String pattern = "MM"; formatter = new SimpleDateFormat(pattern, new Locale("ko", "KOREA")); return formatter.format(date); |
String | getMonth() get Month Calendar calendar = new GregorianCalendar(); int m = calendar.get(GregorianCalendar.MONTH); switch (m) { case 0: return "Jenuary"; case 1: return "February"; case 2: ... |
String | getMonth() get Month Calendar cal = Calendar.getInstance(TimeZone.getDefault()); String DATE_FORMAT = "MM"; java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(DATE_FORMAT); sdf.setTimeZone(TimeZone.getDefault()); String now = sdf.format(cal.getTime()); return now; |