Adds the specified number of millenia to the timestamp.

@param	timestamp
@param	int
@return	timestamp
518602
public static function addMillenium($ts = null, $num = 1)
	{
		return sfTime::add($ts, $num, sfTime::MILLENIUM);
	}
137739
public function putDate(int $timestamp = null): self
    {
        if (null === $timestamp) {
            $date = gmdate('D, d M Y H:i:s');
        } else {
            $date = gmdate('D, d M Y H:i:s', $timestamp);
        }

        $this->put('Date', $date . ' GMT');
        return $this;
    }
1359551
private function getTimestamp($timestamp)
    {
        if ($timestamp instanceof \DateTime) {
            $timestamp = $timestamp->getTimestamp();
        }

        if ((int)$timestamp != $timestamp) {
            throw new ResqueSchedulerInvalidTimestampException(
                'The supplied timestamp value could not be converted to an integer.'
            );
        }

        return (int)$timestamp;
    }
264609
public final Timestamp addYear(int amount)
    {
        if (amount == 0) return this;

        Calendar cal = calendarValue();
        cal.add(Calendar.YEAR, amount);
        return new Timestamp(cal, _precision, _fraction, _offset);
    }
142723
private static function timestampToCounter($timestamp, $timeStep)
    {
        $timestamp = abs(intval($timestamp));
        $counter = intval(($timestamp * 1000) / ($timeStep * 1000));

        return $counter;
    }
723188
function(timestamp) {
        if (!timestamp) {
            return;
        }
        //TODO check this
        //var secondsPerStamp = 1.001,
        var timesplit = timestamp.replace(',', ':').split(':');
        return (parseInt(timesplit[0], 10) * 3600 +
            parseInt(timesplit[1], 10) * 60 +
            parseInt(timesplit[2], 10) +
            parseInt(timesplit[3], 10) / 1000) * 1000 * 1000;

    }
773093
private function getTimestamp(?int $timestamp): int
    {
        $timestamp = $timestamp ?? time();
        Assertion::greaterOrEqualThan($timestamp, 0, 'Timestamp must be at least 0.');

        return $timestamp;
    }
844134
def milliseconds_offset(cls, timestamp, now=None):
        
        if isinstance(timestamp, (int, float)):
            base = timestamp
        else:
            base = cls.to_unix(timestamp)
            base += (timestamp.microsecond / 1000000)
        if now is None:
            now = time.time()
        return (now - base) * 1000
215176
@Override
    public Temporal addTo(Temporal temporal) {
        validateChrono(temporal);
        if (months == 0) {
            if (years != 0) {
                temporal = temporal.plus(years, YEARS);
            }
        } else {
            long monthRange = monthRange();
            if (monthRange > 0) {
                temporal = temporal.plus(years * monthRange + months, MONTHS);
            } else {
                if (years != 0) {
                    temporal = temporal.plus(years, YEARS);
                }
                temporal = temporal.plus(months, MONTHS);
            }
        }
        if (days != 0) {
            temporal = temporal.plus(days, DAYS);
        }
        return temporal;
    }
662340
public void add(Calendar cal) {
    // Avoid precision loss
    // Be aware postgres doesn't return more than 60 seconds - no overflow can happen
    final int microseconds = (int) (getSeconds() * 1000000.0);
    final int milliseconds = (microseconds + ((microseconds < 0) ? -500 : 500)) / 1000;

    cal.add(Calendar.MILLISECOND, milliseconds);
    cal.add(Calendar.MINUTE, getMinutes());
    cal.add(Calendar.HOUR, getHours());
    cal.add(Calendar.DAY_OF_MONTH, getDays());
    cal.add(Calendar.MONTH, getMonths());
    cal.add(Calendar.YEAR, getYears());
  }
360241
public LogicalTimestamp incrementAndUpdate(LogicalTimestamp timestamp) {
    long nextValue = currentTimestamp.value() + 1;
    if (timestamp.value() > nextValue) {
      return update(timestamp);
    }
    return increment();
  }
1116547
public static Date addYear(Date date, int amount) {
        return add(date, Calendar.YEAR, amount);
    }
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)));
    }
1365433
function addMilliseconds($milliseconds) {
        if (!is_int($milliseconds)) return false;
        if ($milliseconds == 0) return true;
        $millisecond = $this->millisecond + $milliseconds;
        $milliseconds = $millisecond % 1000;
        if ($milliseconds < 0) {
            $milliseconds += 1000;
        }
        $seconds = (int)(($millisecond - $milliseconds) / 1000);
        $millisecond = (int)$milliseconds;
        if ($this->addSeconds($seconds)) {
            $this->millisecond = (int)$milliseconds;
            return true;
        }
        else {
            return false;
        }
    }
708199
public static function createFromDOSTimestamp($timestamp, $timezone = null)
    {
        $year          = (($timestamp >> 25) & 0x7f) + 1980;
        $mon           = ($timestamp >> 21) & 0x0f;
        $mday          = ($timestamp >> 16) & 0x1f;
        $hours         = ($timestamp >> 11) & 0x1f;
        $minutes       = ($timestamp >> 5) & 0x3f;
        $seconds       = 2 * ($timestamp & 0x1f);
        $unixTimestamp = mktime($hours, $minutes, $seconds, $mon, $mday, $year);

        return static::createFromTimestamp($unixTimestamp, $timezone);
    }
990421
@Override
        public HebrewTime addTo(
            HebrewTime context,
            long amount
        ) {

            if (amount == 0) {
                return context;
            }

            int h;
            int p;

            switch (this.unit) {
                case HOURS:
                    h = MathUtils.floorModulo(MathUtils.safeAdd(context.hour23, amount), 24);
                    p = context.part;
                    break;
                case HALAKIM:
                    long sum = MathUtils.safeAdd(context.part, amount);
                    p = MathUtils.floorModulo(sum, PARTS_IN_HOUR);
                    long overflow = MathUtils.floorDivide(sum, PARTS_IN_HOUR);
                    h = MathUtils.floorModulo(MathUtils.safeAdd(context.hour23, overflow), 24);
                    break;
                default:
                    throw new UnsupportedOperationException(this.unit.name());
            }

            return new HebrewTime(h, p);

        }
580830
@Override
    public ChronoPeriod plus(TemporalAmount amountToAdd) {
        ChronoPeriodImpl amount = validateAmount(amountToAdd);
        return new ChronoPeriodImpl(
                chrono,
                Math.addExact(years, amount.years),
                Math.addExact(months, amount.months),
                Math.addExact(days, amount.days));
    }