List of utility methods to do Month Add
String | addMonthTimetamp(long lTimeStamp, String _pattern, int month) add Month Timetamp Date date = new Date(lTimeStamp); Calendar cal = Calendar.getInstance(); cal.setTime(date); int y = cal.get(Calendar.YEAR); int m = cal.get(Calendar.MONTH); int d = cal.get(Calendar.DATE); cal.set(y, m + month, d); Date addMonth = cal.getTime(); ... |
Date | getEndOfMonth(Date currentDate) get End Of Month Calendar cal = Calendar.getInstance();
cal.setTime(currentDate);
cal.set(Calendar.DATE, cal.getActualMaximum(Calendar.DATE));
return cal.getTime();
|
Date | getEndOfMonth(Date date) get End Of Month final GregorianCalendar utcCalendar = createUtcCalendar(date); final int maxDay = utcCalendar.getActualMaximum(Calendar.DAY_OF_MONTH); utcCalendar.set(Calendar.DAY_OF_MONTH, maxDay); return getEndOfDay(utcCalendar.getTime()); |
long | getEndOfMonth(long date) Returns the date corresponding to the end of the month. return getMonth(date, 1);
|
String | monthAdd(final String strDate, final int month) month Add final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); Date date; try { date = simpleDateFormat.parse(strDate); final Calendar calender = Calendar.getInstance(); calender.setTime(date); calender.add(Calendar.MONTH, month); return simpleDateFormat.format(calender.getTime()); ... |