Java Utililty Methods Day Add

List of utility methods to do Day Add

Description

The list of methods to do Day Add are organized into topic(s).

Method

DateaddDays(Date d, int days)
add Days
Calendar c = getCalendar();
c.setTime(d);
c.add(Calendar.DATE, days);
return (c.getTime());
DateaddDays(Date d, int n)
add Days
Calendar c = dateToCalendar(d);
c.add(Calendar.DAY_OF_MONTH, n);
return c.getTime();
DateaddDays(Date date, int amount)
Adds a number of days to a date returning a new object.
return add(date, Calendar.DAY_OF_MONTH, amount);
DateaddDays(Date date, int count)
Adds some days to date.
if (null == date) {
    date = new Date();
Date ret = date;
if (0 != count) {
    Calendar calendar = Calendar.getInstance();
    calendar.setTime(date);
    calendar.add(Calendar.DATE, count);
...
DateaddDays(Date date, int day)
add Days
Calendar c = Calendar.getInstance();
c.setTimeInMillis(getMillis(date) + ((long) day) * 24 * 3600 * 1000);
return c.getTime();
DateaddDays(Date date, int days)
add Days
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.DAY_OF_MONTH, days);
return calendar.getTime();
DateaddDays(Date date, int days)
add Days
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.add(Calendar.DATE, days); 
return cal.getTime();
DateaddDays(Date date, int days)
add Days
return add(date, Calendar.DATE, days);
DateaddDays(Date date, int days)
add Days
Calendar cal = new GregorianCalendar();
cal.setTime(date);
cal.add(Calendar.DATE, days);
return cal.getTime();
DateaddDays(Date date, int days)
add Days
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.add(Calendar.DAY_OF_MONTH, days);
return cal.getTime();