List of utility methods to do Day Add
Date | addDays(Date date, int days) add Days if (date == null) return date; Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.set(Calendar.DAY_OF_MONTH, calendar.get(Calendar.DAY_OF_MONTH) + days); return calendar.getTime(); |
Date | addDays(Date date, int daysOffset, boolean stripTime) Adds specified number of days to date and, optionally strips the time component. if (date == null) { return null; Calendar calendar = Calendar.getInstance(); calendar.setLenient(false); calendar.setTime(date); if (stripTime) { calendar.set(Calendar.HOUR_OF_DAY, 0); ... |
Date | addDays(Date date, int daysToAdd) add Days Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
calendar.add(Calendar.DAY_OF_MONTH, daysToAdd);
return calendar.getTime();
...
|
Date | addDays(Date date, int i) add Days Date result;
Calendar calendar = addDaysRetCalendar(date, i);
result = calendar.getTime();
return result;
|
Date | addDays(Date dt, int numDays) Add a number of days to the given day. if (dt == null) return null; GregorianCalendar gc = new GregorianCalendar(); gc.setTime(dt); gc.add(Calendar.DATE, numDays); return gc.getTime(); |
Date | addDays(Date start, int days) add Days Calendar now = Calendar.getInstance();
now.setTime(start);
Calendar working;
working = (Calendar) now.clone();
working.add(Calendar.DAY_OF_YEAR, days);
return working.getTime();
|
Date | addDays(Date startDate, int numDays) add Days Calendar inst = GregorianCalendar.getInstance();
inst.setTime(startDate);
inst.add(Calendar.DAY_OF_YEAR, numDays);
return inst.getTime();
|
Date | addDays(Date when, int amount) add Days return add(when, Calendar.DAY_OF_YEAR, amount);
|
Date | addDays(final Date date, final int addDays) Adds days to the given Date object and returns it. final Calendar dateOnCalendar = Calendar.getInstance(); dateOnCalendar.setTime(date); dateOnCalendar.add(Calendar.DATE, addDays); return dateOnCalendar.getTime(); |
Date | addDays(final Date date, final int days) add Days final GregorianCalendar gc = new GregorianCalendar(); gc.setTime(date); gc.add(Calendar.DAY_OF_MONTH, days); return gc.getTime(); |