Create a dateadd(unit, date, amount) expression

@param unit date part
@param date date
@param amount amount
@return converted date
161071
public static <D extends Comparable> DateTimeExpression<D> dateadd(DatePart unit, DateTimeExpression<D> date, int amount) {
        return Expressions.dateTimeOperation(date.getType(), DATE_ADD_OPS.get(unit), date, ConstantImpl.create(amount));
    }
504821
public static String format(double amount, boolean isUseTraditional, boolean isMoneyMode) {
		final String[] numArray = isUseTraditional ? traditionalDigits : simpleDigits;

		if (amount > 99999999999999.99 || amount < -99999999999999.99) {
			throw new IllegalArgumentException("Number support only: (-99999999999999.99 ～ 99999999999999.99)！");
		}

		boolean negative = false;
		if (amount < 0) {
			negative = true;
			amount = - amount;
		}

		long temp = Math.round(amount * 100);
		int numFen = (int) (temp % 10);
		temp = temp / 10;
		int numJiao = (int) (temp % 10);
		temp = temp / 10;

		//将数字以万为单位分为多份
		int[] parts = new int[20];
		int numParts = 0;
		for (int i = 0; temp != 0; i++) {
			int part = (int) (temp % 10000);
			parts[i] = part;
			numParts++;
			temp = temp / 10000;
		}

		boolean beforeWanIsZero = true; // 标志“万”下面一级是不是 0

		String chineseStr = StrUtil.EMPTY;
		for (int i = 0; i < numParts; i++) {
			String partChinese = toChinese(parts[i], isUseTraditional);
			if (i % 2 == 0) {
				beforeWanIsZero = StrUtil.isEmpty(partChinese);
			}

			if (i != 0) {
				if (i % 2 == 0) {
					chineseStr = "亿" + chineseStr;
				} else {
					if ("".equals(partChinese) && false == beforeWanIsZero) {
						// 如果“万”对应的 part 为 0，而“万”下面一级不为 0，则不加“万”，而加“零”
						chineseStr = "零" + chineseStr;
					} else {
						if (parts[i - 1] < 1000 && parts[i - 1] > 0) {
							// 如果"万"的部分不为 0, 而"万"前面的部分小于 1000 大于 0， 则万后面应该跟“零”
							chineseStr = "零" + chineseStr;
						}
						chineseStr = "万" + chineseStr;
					}
				}
			}
			chineseStr = partChinese + chineseStr;
		}

		// 整数部分为 0, 则表达为"零"
		if (StrUtil.EMPTY.equals(chineseStr)) {
			chineseStr = numArray[0];
		}
		//负数
		if (negative) { // 整数部分不为 0
			chineseStr = "负" + chineseStr;
		}

		// 小数部分
		if (numFen != 0 || numJiao != 0) {
			if (numFen == 0) {
				chineseStr += (isMoneyMode ? "元" : "点") + numArray[numJiao] + (isMoneyMode ? "角" : "");
			} else { // “分”数不为 0
				if (numJiao == 0) {
					chineseStr += (isMoneyMode ? "元零" : "点零") + numArray[numFen] + (isMoneyMode ? "分" : "");
				} else {
					chineseStr += (isMoneyMode ? "元" : "点") + numArray[numJiao] + (isMoneyMode ? "角" : "") + numArray[numFen] + (isMoneyMode ? "分" : "");
				}
			}
		}else if(isMoneyMode) {
			//无小数部分的金额结尾
			chineseStr += "元整";
		}

		return chineseStr;

	}
277448
@Override
    public ChronoZonedDateTime<D> plus(long amountToAdd, TemporalUnit unit) {
        if (unit instanceof ChronoUnit) {
            return with(dateTime.plus(amountToAdd, unit));
        }
        return ChronoZonedDateTimeImpl.ensureValid(getChronology(), unit.addTo(this, amountToAdd));   /// TODO: Generics replacement Risk!
    }
1018712
public static java.util.Date rollDateTime(java.util.Date startDate, int period, int amount) {
        GregorianCalendar gc = new GregorianCalendar();
        gc.setTime(startDate);
        gc.add(period, amount);
        return new java.util.Date(gc.getTime().getTime());
    }
455565
public static Date addMonths(final Date date, final int addMonths)
	{
		final Calendar dateOnCalendar = Calendar.getInstance();
		dateOnCalendar.setTime(date);
		dateOnCalendar.add(Calendar.MONTH, addMonths);
		return dateOnCalendar.getTime();
	}
1364834
@Override
    @SuppressWarnings("unchecked")
    public D plus(TemporalAmount amount) {
        return (D) ChronoLocalDate.super.plus(amount);
    }
1075584
public static <D extends Comparable> NumberExpression<Integer> datediff(DatePart unit,
            DateExpression<D> start, DateExpression<D> end) {
        return Expressions.numberOperation(Integer.class, DATE_DIFF_OPS.get(unit), start, end);
    }
1276422
public static DateValue add(DateValue date, DateValue duration) {
		DTBuilder db = new DTBuilder(date);
		db.year += duration.year();
		db.month += duration.month();
		db.day += duration.day();
		if (duration instanceof TimeValue) {
			TimeValue tdur = (TimeValue) duration;
			db.hour += tdur.hour();
			db.minute += tdur.minute();
			db.second += tdur.second();
			return db.toDateTime();
		}
		return (date instanceof TimeValue) ? db.toDateTime() : db.toDate();
	}
825968
public static Date addDays(final Date date, final int addDays)
	{
		final Calendar dateOnCalendar = Calendar.getInstance();
		dateOnCalendar.setTime(date);
		dateOnCalendar.add(Calendar.DATE, addDays);
		return dateOnCalendar.getTime();
	}
940913
public Expression<java.util.Date> in(java.util.Date[] value) {
		SimpleDateFormat formatter = getDateTimeFormatter();
		String valueString = "";
		Boolean firstCalendar = true;
		for (Date v : value) {
			if (firstCalendar) {
				valueString = valueString.concat("('").concat(formatter.format(v).concat("Z")).concat("'");
				firstCalendar = false;
			} else {
				valueString = valueString.concat(", '").concat(formatter.format(v).concat("Z")).concat("'");
			}
		}

		valueString = valueString.concat(")");
		return new Expression<java.util.Date>(this, Operation.in, valueString);
	}
958827
public static long calc(Date arg0, Date arg1, DateUnit dateUnit) {
        return calc(arg0.toInstant(), arg1.toInstant(), dateUnit);
    }
348784
private ChronoPeriodImpl validateAmount(TemporalAmount amount) {
        Objects.requireNonNull(amount, "amount");
        if (amount instanceof ChronoPeriodImpl == false) {
            throw new DateTimeException("Unable to obtain ChronoPeriod from TemporalAmount: " + amount.getClass());
        }
        ChronoPeriodImpl period = (ChronoPeriodImpl) amount;
        if (chrono.equals(period.getChronology()) == false) {
            throw new ClassCastException("Chronology mismatch, expected: " + chrono.getId() + ", actual: " + period.getChronology().getId());
        }
        return period;
    }
1061111
def date_add(start, days):
    
    sc = SparkContext._active_spark_context
    return Column(sc._jvm.functions.date_add(_to_java_column(start), days))
859291
public Date add(Date date) {
		Calendar c = Calendar.getInstance();
		c.setTime(date);

		if (weeks != null) {
			int weeks = this.weeks * (prior ? -1 : 1);
			c.add(Calendar.DATE, weeks * 7);
		}
		if (days != null) {
			int days = this.days * (prior ? -1 : 1);
			c.add(Calendar.DATE, days);
		}
		if (hours != null) {
			int hours = this.hours * (prior ? -1 : 1);
			c.add(Calendar.HOUR_OF_DAY, hours);
		}
		if (minutes != null) {
			int minutes = this.minutes * (prior ? -1 : 1);
			c.add(Calendar.MINUTE, minutes);
		}
		if (seconds != null) {
			int seconds = this.seconds * (prior ? -1 : 1);
			c.add(Calendar.SECOND, seconds);
		}

		return c.getTime();
	}
499562
public XMLGregorianCalendar addDays(final XMLGregorianCalendar cal, final int amount) {
        XMLGregorianCalendar to = buildXMLGregorianCalendarDate(cal);
        // Add amount of months
        to.add(addDays(amount));
        return to;
    }
1163058
def dateadd(value: fields.DateTime(),
            addend: fields.Int(validate=Range(min=1)),
            unit: fields.Str(validate=OneOf(['minutes', 'days']))='days'):
    """"""
    value = value or dt.datetime.utcnow()
    if unit == 'minutes':
        delta = dt.timedelta(minutes=addend)
    else:
        delta = dt.timedelta(days=addend)
    result = value + delta
    return {'result': result}
1073893
public static Temporal edate(EvaluationContext ctx, Object date, Object months) {
        Temporal dateOrDateTime = Conversions.toDateOrDateTime(date, ctx);
        int _months = Conversions.toInteger(months, ctx);
        return dateOrDateTime.plus(_months, ChronoUnit.MONTHS);
    }