List of utility methods to do Date Add
Date | add(Date actual, Integer type, Integer count) add Calendar calendar = Calendar.getInstance();
calendar.setTime(actual);
calendar.add(type, count);
return calendar.getTime();
|
Date | add(Date date, int calendarField, int amount) Adds to a date returning a new object. if (date == null) { throw new IllegalArgumentException("The date must not be null"); Calendar c = Calendar.getInstance(); c.setTime(date); c.add(calendarField, amount); return c.getTime(); |
Date | add(Date date, int calendarField, int amount) Adds to a date returning a new object. if (date == null) { throw new IllegalArgumentException("The date must not be null"); Calendar c = Calendar.getInstance(); c.setTime(date); c.add(calendarField, amount); return c.getTime(); |
Date | add(Date date, int calendarField, int amount) Adds to a date returning a new object. if (date == null) { throw new IllegalArgumentException("The date must not be null"); Calendar c = Calendar.getInstance(); c.setTime(date); c.add(calendarField, amount); return c.getTime(); |
Date | add(Date date, int field, int amount) Date Arithmetic function. Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.add(field, amount);
return cal.getTime();
|
Date | add(Date date, int field, int amount) Date Arithmetic function. Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.add(field, amount);
return cal.getTime();
|
Date | add(Date date, int field, int diff) add Calendar c = getCalendar(date);
c.add(field, diff);
return c.getTime();
|
Date | add(Date date, int field, int value) add Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(date.getTime());
cal.add(field, value);
return cal.getTime();
|
Date | add(Date date, int field, long amount) Adds the specified (signed) amount of time to the given time field, based on the calendar's rules. Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.add(field, (int) amount); return calendar.getTime(); |
Date | add(Date date, int x) add return addDays(date, x);
|