Adds the specified number of years to the timestamp.

@param	timestamp
@param	int
@return	timestamp
322503
public static function addYear($ts = null, $num = 1)
	{
		return sfTime::add($ts, $num, sfTime::YEAR);
	}
399399
public static function roundTimestampDownToMonth($timestamp)
    {
        $month = date('n', $timestamp);
        $year  = date('Y', $timestamp);
                
        $roundedTimestamp = mktime(0, 0, 0, $month, $day="01", $year);
                
        return $roundedTimestamp;
    }
1304854
public static String longToDateTime(long timestamp) {
        Date date = new Date(timestamp * 1000);
        DateFormat formatter = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss");
        return formatter.format(date);
    }
398926
public static function finalDayOfYear($ts = null)
	{
		return sfTime::subtractDay(sfTime::firstDayOfYear(sfTime::addYear($ts)));
	}
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;
    }
570514
public Timestamp withLocalOffset(Integer offset)
    {
        Precision precision = getPrecision();
        if (precision.alwaysUnknownOffset() ||
            safeEquals(offset, getLocalOffset()))
        {
            return this;
        }

        Timestamp ts = createFromUtcFields(precision,
                                           getZYear(),
                                           getZMonth(),
                                           getZDay(),
                                           getZHour(),
                                           getZMinute(),
                                           getZSecond(),
                                           getZFractionalSecond(),
                                           offset);
        return ts;
    }
50936
public void add(long timestamp, T object) {
		JMMap.getOrPutGetNew(this.timeSeriesMap, buildKeyTimestamp(timestamp),
				ArrayList::new).add(object);
	}
569839
public static long changeTimestampToLong(SimpleDateFormat simpleDateFormat,
            String timestamp) {
        try {
            synchronized (simpleDateFormat) {
                return simpleDateFormat.parse(timestamp).getTime();
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
1182747
public static function unix2dos($timestamp = 0)
    {
        $timestamp = ! $timestamp ? getdate() : getdate($timestamp);

        if ($timestamp['year'] < 1980)
        {
            return (1 << 21 | 1 << 16);
        }

        $timestamp['year'] -= 1980;

        return ($timestamp['year'] << 25 | $timestamp['mon'] << 21 |
            $timestamp['mday'] << 16 | $timestamp['hours'] << 11 |
            $timestamp['minutes'] << 5 | $timestamp['seconds'] >> 1);
    }
503974
static String date(final long timestamp) {
    if ((timestamp & Const.SECOND_MASK) != 0) {
      return new Date(timestamp).toString();
    } else {
      return new Date(timestamp * 1000).toString();
    }
  }
1116547
public static Date addYear(Date date, int amount) {
        return add(date, Calendar.YEAR, amount);
    }
1151313
@Override
    public ChronoZonedDateTime<D> plus(long amountToAdd, TemporalUnit unit) {
        if (unit instanceof ChronoUnit) {
            return with(dateTime.plus(amountToAdd, unit));
        }
        return toLocalDate().getChronology().ensureChronoZonedDateTime(unit.addTo(this, amountToAdd));   /// TODO: Generics replacement Risk!
    }
52055
public void add(long timestamp, String column, Object value) {
        if (!(value instanceof Long) && !(value instanceof Integer) && !(value instanceof Double) &&
            !(value instanceof Float) && !(value instanceof Boolean) &&
            !(value instanceof String)) {
            throw new IllegalArgumentException(
                "value must be of type: Long, Integer, Double, Float, Boolean, or String");
        }
        Map<String, Object> temp = new HashMap<String, Object>();
        temp.put(column, value);
        add(timestamp, temp);
    }
964077
public static Date getFromTimestamp(Timestamp timestamp) {
        if (timestamp == null) {
            return null;
        }
        return new Date(timestamp.getTime());
    }
981948
private Date timestampToDate(Timestamp ts) {
    long millis = ts.getTime();
    int nanos = ts.getNanos();
    return new Date(millis / 1000 * 1000 + nanos / 1000000);
  }
1344345
public DateFuncSup nextYear(int next) {
                Calendar cal = Calendar.getInstance();
                cal.setTime(date);
                cal.add(Calendar.YEAR, next);
                date.setTime(cal.getTimeInMillis());
                return this;
        }
305903
public static MutableDataPoint ofLongValue(final long timestamp,
                                             final long value) {
    final MutableDataPoint dp = new MutableDataPoint();
    dp.reset(timestamp, value);
    return dp;
  }