Returns a timestamp relative to this one by the given number of days.

@param amount a number of days.
324282
public final Timestamp addDay(int amount)
    {
        long delta = (long) amount * 24 * 60 * 60 * 1000;
        return addMillisForPrecision(delta, Precision.DAY, false);
    }
625783
public static Date addSecond(String date, int amount) throws ParseException {
        return add(date, Calendar.SECOND, amount);
    }
511572
@Override
	public double getPaymentOffset(double fixingTime) {
		if(paymentOffsetCode == null) {
			return paymentOffset;
		}

		if(paymentOffsets.containsKey(fixingTime)) {
			return paymentOffsets.get(fixingTime);
		}
		else {
			/**
			 *  @TODO In case paymentDate is relevant for the index modeling, it should be checked
			 *  if the following derivation of paymentDate is accurate (e.g. wo we have a fixingOffset).
			 *  In such a case, this method may be overridden.
			 */
			LocalDate referenceDate = getReferenceDate();
			LocalDate fixingDate = FloatingpointDate.getDateFromFloatingPointDate(referenceDate, fixingTime);
			LocalDate paymentDate = paymentBusinessdayCalendar.getAdjustedDate(fixingDate, paymentOffsetCode, paymentDateRollConvention);
			double paymentTime = FloatingpointDate.getFloatingPointDateFromDate(referenceDate, paymentDate);
			paymentOffsets.put(fixingTime, paymentTime-fixingTime);
			return paymentTime-fixingTime;
		}
	}
402656
public static Date addDay(String date, int amount) throws ParseException {
        return add(date, Calendar.DATE, amount);
    }
1156955
public static long timestampFloor(TimeUnitRange range, long ts, TimeZone tz) {
		// assume that we are at UTC timezone, just for algorithm performance
		long offset = tz.getOffset(ts);
		long utcTs = ts + offset;

		switch (range) {
			case HOUR:
				return floor(utcTs, MILLIS_PER_HOUR) - offset;
			case DAY:
				return floor(utcTs, MILLIS_PER_DAY) - offset;
			case MONTH:
			case YEAR:
			case QUARTER:
				int days = (int) (utcTs / MILLIS_PER_DAY + EPOCH_JULIAN);
				return julianDateFloor(range, days, true) * MILLIS_PER_DAY - offset;
			default:
				// for MINUTE and SECONDS etc...,
				// it is more effective to use arithmetic Method
				throw new AssertionError(range);
		}
	}
243451
public static Date add(DateUnit dateUnit, int amount, String date, String format) {
        LocalDateTime localDateTime = getTime(format, date);
        localDateTime = localDateTime.plus(amount, create(dateUnit));
        return Date.from(localDateTime.toInstant(ZoneOffset.ofTotalSeconds(60 * 60 * 8)));
    }
807697
def get_timestamp(dt=None):
    '''
    
    '''

    if dt is None: dt = datetime.datetime.utcnow()
    t = dt.utctimetuple()

    return calendar.timegm(t)
378167
public static Date addMonth(Date date, int amount) {
        return add(date, Calendar.MONTH, amount);
    }
585784
public LambdaDslObject timestamp(String name, String format, Instant example) {
        object.timestamp(name, format, example);
        return this;
    }
18027
void timestampFormat(DateFormat format, String... attributes) {
        convertWith(new DateToStringConverter(format), attributes);
        convertWith(new StringToTimestampConverter(format), attributes);
    }
381821
public void record(long amount) {
    if (amount >= 0) {
      totalAmount.increment(amount);
      count.increment();
      max.update(amount);
      min.update(amount);
    }
  }
208821
@Override
    public Instant plus(long amountToAdd, TemporalUnit unit) {
        if (unit instanceof ChronoUnit) {
            switch ((ChronoUnit) unit) {
                case NANOS: return plusNanos(amountToAdd);
                case MICROS: return plus(amountToAdd / 1000000, (amountToAdd % 1000000) * 1000);
                case MILLIS: return plusMillis(amountToAdd);
                case SECONDS: return plusSeconds(amountToAdd);
                case MINUTES: return plusSeconds(Jdk8Methods.safeMultiply(amountToAdd, SECONDS_PER_MINUTE));
                case HOURS: return plusSeconds(Jdk8Methods.safeMultiply(amountToAdd, SECONDS_PER_HOUR));
                case HALF_DAYS: return plusSeconds(Jdk8Methods.safeMultiply(amountToAdd, SECONDS_PER_DAY / 2));
                case DAYS: return plusSeconds(Jdk8Methods.safeMultiply(amountToAdd, SECONDS_PER_DAY));
            }
            throw new UnsupportedTemporalTypeException("Unsupported unit: " + unit);
        }
        return unit.addTo(this, amountToAdd);
    }
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;
    }
569871
public static Date calculatePastDate(int days) {
        final Calendar cal = Calendar.getInstance();
        cal.add(Calendar.DATE, -days);

        return cal.getTime();
    }
1116547
public static Date addYear(Date date, int amount) {
        return add(date, Calendar.YEAR, amount);
    }
583149
public static Integer getDay(Day day)
   {
      Integer result = null;
      if (day != null)
      {
         result = DAY_MAP.get(day);
      }
      return (result);
   }
795605
public static Timestamp of(java.sql.Timestamp timestamp) {
    return ofTimeSecondsAndNanos(timestamp.getTime() / 1000, timestamp.getNanos());
  }