Checks if two timestamps fall on the same date of the year (e.g. February 25th)

@param int $ts1 First timestamp
@param int $ts2 Second timestamp
@return bool
165144
public static function isOnSameDayOfYear($ts1 = 0, $ts2 = 0, $tz = null) {
		if (!Util::isValidTimezone($tz)) {
			$tz = Util::getClientTimezone();
		}
		
		$dt1 = new DateTime(null, new DateTimeZone($tz));
		$dt2 = new DateTime(null, new DateTimeZone($tz));
		return $dt1->setTimestamp($ts1)->format('m-j') == $dt2->setTimestamp($ts2)->format('m-j');
	}
1263594
public static boolean isSameDay(Calendar cal1, Calendar cal2) {
		if (cal1 == null || cal2 == null) {
			throw new IllegalArgumentException("The date must not be null");
		}
		return cal1.get(Calendar.DAY_OF_YEAR) == cal2.get(Calendar.DAY_OF_YEAR) && //
				cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) && //
				cal1.get(Calendar.ERA) == cal2.get(Calendar.ERA);
	}
14663
public static function subtractCentury($ts = null, $num = 1)
	{
		return sfTime::subtract($ts, $num, sfTime::CENTURY);
	}
447204
public static function timestamp($timestamp = null)
    {
        if (!self::isDebug()) {
            return false;
        }

        $date = date(DATE_RFC822, $timestamp);
        return self::i()->dump($date, $timestamp . ' sec = ');
    }
571830
public static function subtractDay($ts = null, $num = 1)
	{
		return sfTime::subtract($ts, $num, sfTime::DAY);
	}
609621
public static function isTimestamp($tstamp)
    {
        return ((string)(int)$tstamp === $tstamp)
        && ($tstamp <= PHP_INT_MAX)
        && ($tstamp >= ~PHP_INT_MAX);
    }
1100045
private function _checkExpired($timestamp, $expiration) {
    $result = false;
    if ($expiration !== 0) {
      $timeDiff = time() - $timestamp;
      ($timeDiff > $expiration) ? $result = true : $result = false;
    }
    return $result;
  }
270109
public function set_timestamp($ts = null)
    {
        if (!is_numeric($ts)) {
            $this->time = null;
            $this->adate = null;
            return $this;
        }
        
        $old_year = ($this->time == null) ? false : $this->adate['year'];
        
        $this->time = $ts;
        $this->adate = getdate($ts);
        
        $this->adate['daysInMonth'] = date('t', $ts);
        
        //Test si on doit recalculer les jours fériés
        if ($old_year === false || $old_year != $this->adate['year']) {
            $this->set_joursferies($this->adate['year']);
        }
        
        return $this;
    }
612914
function isDayAfter(d1, d2) {
  var day1 = clone(d1).setHours(0, 0, 0, 0);
  var day2 = clone(d2).setHours(0, 0, 0, 0);
  return day1 > day2;
}
1167507
protected function compare($schedule1, $schedule2)
    {
        $run1 = $schedule1->getNextRunDate();
        $run2 = $schedule2->getNextRunDate();
        if ($run1 < $run2) {
            return 1;
        } elseif ($run1 > $run2) {
            return -1;
        }

        return 0;
    }
446560
public function equals($value)
    {
        if ($value instanceof \DateTime) {
            $timestamp = $value->getTimeStamp();
        } else {
            $timestamp = strtotime($value);
        }

        return ($timestamp == $this->value->getTimeStamp());
    }
84248
public static function firstDayOfMonth($ts = null)
	{
		// default to now
		if ($ts === null) $ts = sfDateTimeToolkit::now();
		
		return sfTime::subtractDay($ts, date('d', $ts) - 1);
	}
1210365
function isSameDay(d1, d2) {
  if (!d1 || !d2) {
    return false;
  }
  return d1.getDate() === d2.getDate() && d1.getMonth() === d2.getMonth() && d1.getFullYear() === d2.getFullYear();
}
476499
public function isEqual(MoneyInterface $first, MoneyInterface $second)
    {
        $this->resolveCurrency($first, $second);
        return $this->math->isEqual($first->getAmount(), $second->getAmount());
    }
971889
function(month, year1, year2) {
    var leap1 = isLeap(year1 - 1);
    var leap2 = isLeap(year2 - 1);

    if(month < 5 + leap1) return 0;
    return leap2 - leap1;
  }
11321
private function timestampHasExpired($timestamp) {
        $year   = substr($timestamp, 0, 4);
        $month  = substr($timestamp, 5, 2);
        $day    = substr($timestamp, 8, 2);
        $hour   = substr($timestamp, 11, 2);
        $minute = substr($timestamp, 14, 2);
        $second = substr($timestamp, 17, 2);

        $timestamp = gmmktime($hour, $minute, $second, $month, $day, $year);

        $diff = time() - $timestamp;

        if ($diff > $this->maxDiff || $diff < -$this->maxDiff) {
            return true;
        }

        return false;
    }
325085
public function isGt(MoneyInterface $first, MoneyInterface $second)
    {
        $this->resolveCurrency($first, $second);
        return $this->math->isGt($first->getAmount(), $second->getAmount());
    }