List of utility methods to do Month Date Get
int | getCurrentMonth() get Current Month CALENDAR.setTime(new Date()); return CALENDAR.get(Calendar.MONTH) + 1; |
String | getStringMonth(Date date) get String Month Calendar cal = Calendar.getInstance(); SimpleDateFormat month_date = new SimpleDateFormat("MMMM"); return month_date.format(cal.getTime()); |
String | getMonth(int month, Locale locale) get Month return DateFormatSymbols.getInstance(locale).getMonths()[month - 1];
|
String | getMonthName(String substring) get Month Name switch (Integer.parseInt(substring)) { case 1: return "Jan"; case 2: return "Feb"; case 3: return "Mar"; case 4: ... |
long | getEndCurrentMonth() get End Current Month return getEndCurrentMonthCal().getTimeInMillis();
|
Calendar | getEndCurrentMonthCal() get End Current Month Cal Calendar calendar = getCalendar();
calendar.set(Calendar.DAY_OF_MONTH,
calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
calendar.set(Calendar.HOUR_OF_DAY, 23);
calendar.set(Calendar.MINUTE, 59);
calendar.set(Calendar.SECOND, 59);
calendar.set(Calendar.MILLISECOND, 999);
return calendar;
...
|
long | getStartCurrentMonth() get Start Current Month return getStartCurrentMonthCal().getTimeInMillis();
|
Calendar | getStartCurrentMonthCal() get Start Current Month Cal Calendar calendar = getCalendar();
calendar.set(Calendar.DAY_OF_MONTH,
calendar.getActualMinimum(Calendar.DAY_OF_MONTH));
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
return calendar;
...
|