Adds a number of days to a date returning a new object.
The original date object is unchanged.

@param date         the date, not null
@param numberOfDays the amount to add, may be negative
@return the new date object with the amount added
183698
public static Date addDays(Date date, int numberOfDays) {
    return Date.from(date.toInstant().plus(numberOfDays, ChronoUnit.DAYS));
  }
569871
public static Date calculatePastDate(int days) {
        final Calendar cal = Calendar.getInstance();
        cal.add(Calendar.DATE, -days);

        return cal.getTime();
    }
745779
def add_days(number)
      if number < 0
        return sub_days(number.abs)
      end
      o = dup  # new ZDate object
      # Let's see what month we are going to end in
      while number > 0
        if o.days_left_in_month >= number
          o.date = ZDate.format_date(o.year_str, o.month_str, o.day + number)
          number = 0
        else
          number = number - 1 - o.days_left_in_month  # it costs 1 day to increment the month
          o.increment_month!
        end
      end
      o
    end
851404
public D plus(CalendarDays days) {

        long result = Math.addExact(this.getDaysSinceEpochUTC(), days.getAmount());

        try {
            return this.getChronology().getCalendarSystem().transform(result);
        } catch (IllegalArgumentException iae) {
            ArithmeticException ex = new ArithmeticException("Out of range: " + result);
            ex.initCause(iae);
            throw ex;
        }

    }
10526
public static int getWeekdayOfDate(String date) {
		SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
		int weekday = 0;
		Calendar c = Calendar.getInstance();
		try {
			c.setTime(formatter.parse(date));
			weekday = c.get(Calendar.DAY_OF_WEEK);
		} catch (ParseException e) {
			e.printStackTrace();
		}
		return weekday;
	}
934599
public static String dateIncreaseByDay(String date, String fmt, int days) {
        return dateIncrease(date, fmt, Calendar.DATE, days);
    }
1036313
function incrementDays(date, numberOfDays) {
      return new Date(date.getFullYear(), date.getMonth(), date.getDate() + numberOfDays);
    }
102759
public static Date dateReservedDay000(Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        return dateReservedDay000(calendar);
    }
762897
public static Date addSeconds(final Date date, final int addSeconds)
	{
		final Calendar dateOnCalendar = Calendar.getInstance();
		dateOnCalendar.setTime(date);
		dateOnCalendar.add(Calendar.SECOND, addSeconds);
		return dateOnCalendar.getTime();
	}
214906
public static Date addMinutes(final Date date, final int addMinutes)
	{
		final Calendar dateOnCalendar = Calendar.getInstance();
		dateOnCalendar.setTime(date);
		dateOnCalendar.add(Calendar.MINUTE, addMinutes);
		return dateOnCalendar.getTime();
	}
615232
public static int days(EvaluationContext ctx, Object endDate, Object startDate) {
        return datedif(ctx, startDate, endDate, "d");
    }
840371
public static Date toDateAddDaysSetOfWeek(int days, int dayOfWeek)
   {
	Calendar cal = Calendar.getInstance();
	
	cal.add(Calendar.DAY_OF_YEAR, days);
	
	
	return cal.getTime();
   }
814887
public static Date addDate(final Date date, final Integer different) {
		final Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		cal.add(Calendar.DATE, different);
		return cal.getTime();
	}
128931
public static int getDayOfWeek(@NotNull final Date date) {
		int result = getWithMondayFirst(date, Calendar.DAY_OF_WEEK);
		return result == 1 ? 7 : result - 1;
	}
371166
public static Date add(Date date, int field, int amount) {
        CALENDAR.setTime(date);
        CALENDAR.add(field, amount);
        return CALENDAR.getTime();
    }
625783
public static Date addSecond(String date, int amount) throws ParseException {
        return add(date, Calendar.SECOND, amount);
    }
448384
public CalendarDateCalculator moveByDays(final int days) {
        setCurrentIncrement(days);
        getCurrentBusinessDate().add(Calendar.DAY_OF_MONTH, days);

        if (getHolidayHandler() != null) {
            setCurrentBusinessDate(getHolidayHandler().moveCurrentDate(this));
        }

        return this;
    }