List of utility methods to do Month Date Get
int | getCurrentMonth(Date date) get Current Month Calendar calendar = new GregorianCalendar(); calendar.setTime(date); return calendar.get(Calendar.MONTH) + 1; |
int | monthNumber(Date date) month Number Calendar calendar = calendarDate(date);
return calendar.get(Calendar.MONTH);
|
int | maxMonthDate(Date date) max Month Date Calendar calendar = calendarDate(date);
return calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
|
Date | getMonthStartDate(Date date) get Month Start Date Calendar calendar = calendarDate(date);
calendar.set(Calendar.DAY_OF_MONTH,
calendar.getActualMinimum(Calendar.DAY_OF_MONTH));
Date startDate = calendar.getTime();
return startDate;
|
Date | getMonthEndDate(Date date) get Month End Date Calendar calendar = calendarDate(date);
calendar.set(Calendar.DAY_OF_MONTH,
calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
Date endDate = calendar.getTime();
return endDate;
|
int | getCurrentMonth() Gets the month element from today date. return getMonthFromDate(new Date()); |
int | monthNumber() month Number return monthNumber(new Date()); |
int | getInterval(String beginMonth, String endMonth) get Interval int intBeginYear = Integer.parseInt(beginMonth.substring(0, 4)); int intBeginMonth = Integer.parseInt(beginMonth .substring(beginMonth.indexOf("-") + 1)); int intEndYear = Integer.parseInt(endMonth.substring(0, 4)); int intEndMonth = Integer.parseInt(endMonth.substring(endMonth .indexOf("-") + 1)); return ((intEndYear - intBeginYear) * 12) + (intEndMonth - intBeginMonth) + 1; ... |
Date | monthOffset(Date date, int offset) month Offset return offsetDate(date, Calendar.MONTH, offset);
|
int | getMonth() get Month return Calendar.getInstance().get(Calendar.MONTH);
|