List of utility methods to do Calendar Add
Calendar | add(Calendar calendar, int calendarField, int amount) add Calendar c = Calendar.getInstance();
c.setTime(calendar.getTime());
c.add(calendarField, amount);
return c;
|
Date | add(Date _date, int _calendarField, int _amount) add if (_date == null) { return _date; Calendar c = Calendar.getInstance(); c.setTime(_date); c.add(_calendarField, _amount); return c.getTime(); |
Date | add(Date date, int calendarField, int amount) add if (date == null) { throw new IllegalArgumentException("The date must not be null"); } else { Calendar c = Calendar.getInstance(); c.setTime(date); c.add(calendarField, amount); return c.getTime(); |
Date | add(Date inputDate, int interval, int calendarUnit) Add Interval to Date Calendar cal = Calendar.getInstance();
cal.setTime(formateDateWithoutTime(inputDate));
cal.add(calendarUnit, interval);
return cal.getTime();
|
Date | add(final Date date, final int calendarField, final int amount) Adds to a date returning a new object. if (date == null) { throw new IllegalArgumentException("The date must not be null"); final Calendar c = Calendar.getInstance(); c.setTime(date); c.add(calendarField, amount); return c.getTime(); |
Calendar | add2Calendar(Calendar cal, int years, int months, int days, int hours, int minutes, int seconds, int millis) Adds the specified values to the values to the specified Calendar instance and returns the result. if (years != 0) cal.add(Calendar.YEAR, years); if (months != 0) cal.add(Calendar.MONTH, months); if (days != 0) cal.add(Calendar.DAY_OF_MONTH, days); if (hours != 0) cal.add(Calendar.HOUR_OF_DAY, hours); ... |
void | addCalendarDate(Calendar cal, int date) add Calendar Date cal.add(Calendar.DATE, date); |
long | addCalendarMonthsToUnixtime(long time, int interval) Add the specified amount of months to the given time. The day of month will stay the same. Calendar c = Calendar.getInstance();
c.setTimeInMillis(time);
c.add(Calendar.MONTH, interval);
return c.getTimeInMillis();
|
void | addCalendarQuarterOfYear(Calendar cal, int quartersOfYear) add Calendar Quarter Of Year addCalendarMonth(cal, quartersOfYear * 3); |
Calendar | addDate(Calendar baseDate, int addDate) add Date return add(baseDate, 0, 0, addDate, 0, 0, 0, 0);
|