Adds seconds to the given Date object and returns it. Note: you can add negative values too
for get date in past.

@param date
The Date object to add the seconds.
@param addSeconds
The seconds to add.
@return The resulted Date object.
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();
	}
332904
public static Date nextWeek(@NotNull final Date date) {
		return DateUtils.truncate(DateUtil.addDays(date, 8 - DateUtil.getDayOfWeek(date)), Calendar.DATE);
	}
624224
public static Date dateIncreaseByDay(Date date, int days) {

        Calendar cal = GregorianCalendar.getInstance();
        cal.setTime(date);
        cal.add(Calendar.DATE, days);

        return cal.getTime();
    }
1363601
public static Date plusSeconds(Date date, int seconds) {
		return plus(date, seconds, DateTimeField.SECONDS);
	}
828776
public static Date plusDays(Date date, int days) {
		return plus(date, days, DateTimeField.DAY);
	}
1093646
public static DateValue getInstance(Date date) {
        DateValue result;
        if (date != null) {
            synchronized (cache) {
                result = cache.get(date);
                if (result == null) {
                    result = new DateValue(date);
                    cache.put(date, result);
                }
            }
        } else {
            result = getInstance(new Date());
        }
        return result;
    }
83708
public static Date fromJavaUtilDate(java.util.Date date) {
    Calendar cal = Calendar.getInstance();
    cal.setTime(date);
    cal.set(Calendar.HOUR_OF_DAY, 0);
    cal.set(Calendar.MINUTE, 0);
    cal.set(Calendar.SECOND, 0);
    cal.set(Calendar.MILLISECOND, 0);
    // Calender.MONTH starts from 0 while G C date starts from 1
    return new Date(
        cal.get(Calendar.YEAR), cal.get(Calendar.MONTH) + 1, cal.get(Calendar.DAY_OF_MONTH));
  }
749965
public static String addDayByString(String date, int addDay) {
        String retDate = "";
        // 空值校验
        if (date == null || "".equals(date)
                || "".equals(date.replaceAll("-", "").trim())) {
            return retDate;
        }
        Date date1 = stringToDate(date);
        Calendar c = Calendar.getInstance();
        c.setTime(date1); // 设置当前日期
        c.add(Calendar.DATE, addDay); // 日期加1
        Date resultDate = c.getTime(); // 结果
        return dateToString(resultDate);
    }
271404
public static Date substractYearsFromDate(final Date date, final int substractYears)
	{
		final Calendar dateOnCalendar = Calendar.getInstance();
		dateOnCalendar.setTime(date);
		dateOnCalendar.add(Calendar.YEAR, substractYears * -1);
		return dateOnCalendar.getTime();
	}
569871
public static Date calculatePastDate(int days) {
        final Calendar cal = Calendar.getInstance();
        cal.add(Calendar.DATE, -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();
	}
154843
public static <D extends Comparable> DateTimeExpression<D> addDays(DateTimeExpression<D> date, int days) {
        return Expressions.dateTimeOperation(date.getType(), Ops.DateTimeOps.ADD_DAYS, date, ConstantImpl.create(days));
    }
756239
public static Date addDays(Date date, int days)
   {
      Calendar cal = popCalendar(date);
      cal.add(Calendar.DAY_OF_YEAR, days);
      Date result = cal.getTime();
      pushCalendar(cal);
      return result;   
   }
191079
public final boolean add(final Date date) {
        if (!this.isUtc() && this.getTimeZone() == null) {
            /* If list hasn't been initialized yet use defaults from the first added date element */
            if (date instanceof DateTime) {
                DateTime dateTime = (DateTime) date;
                if (dateTime.isUtc()) {
                    this.setUtc(true);
                } else {
                    this.setTimeZone(dateTime.getTimeZone());
                }
            }
        }
        if (date instanceof DateTime) {
            DateTime dateTime = (DateTime) date;
            if (isUtc()) {
                dateTime.setUtc(true);
            } else {
                dateTime.setTimeZone(getTimeZone());
            }
        } else if (!Value.DATE.equals(getType())) {
            final DateTime dateTime = new DateTime(date);
            dateTime.setTimeZone(getTimeZone());
            return dates.add(dateTime);
        }
        return dates.add(date);
    }
1174001
public void addValue(Date date) {
        String dateString = XmppDateTime.formatXEP0082Date(date);
        addValue(dateString);
    }
212197
function(date) {
        var start = this.findMonthStart(date);
        var nextMonth = this.add(start, this.MONTH, 1);
        var end = this.subtract(nextMonth, this.DAY, 1);
        return end;
    }
270616
public static Date addMinute(String date, int amount) throws ParseException {
        return add(date, Calendar.MINUTE, amount);
    }