Returns the timestamp of the next run date.

@return int
171901
public function getNextRunDate()
    {
        if ($this->nextRunDate === null) {
            $nextRun = $this->cronExpression->getNextRunDate();
            $this->nextRunDate = $nextRun->getTimestamp();
        }

        return $this->nextRunDate;
    }
661945
public static function getCurrentTimestamp()
    {
        $database = self::getDatabase();
        $sql = 'SELECT CURRENT_TIMESTAMP';
        return $database->query($sql)->fetch(\PDO::FETCH_NUM)[0];
    }
961480
public function getUtcNowForDb()
    {
        $dt = $this->getUtcNow();
        $result = $this->hlpFormat->dateTimeForDb($dt);
        return $result;
    }
510223
public function getStartDate() : ?int 
    {
        if ( ! $this->hasStartDate()) {
            $this->setStartDate($this->getDefaultStartDate());
        }
        return $this->startDate;
    }
42871
public static function getMinuteTimestamp($now = null) {
        $now = $now === null ? time() : $now;
        $diff = $now % 60;
        return $now - $diff;
    }
1232632
public function getAge()
    {
        if (!$this->hasDateOfBirth()) {
            return 0;
        }

        $currentTimestamp = $GLOBALS['EXEC_TIME'];
        $birthTimestamp = $this->getDateOfBirth();

        $currentYear = (int)strftime('%Y', $currentTimestamp);
        $currentMonth = (int)strftime('%m', $currentTimestamp);
        $currentDay = (int)strftime('%d', $currentTimestamp);
        $birthYear = (int)strftime('%Y', $birthTimestamp);
        $birthMonth = (int)strftime('%m', $birthTimestamp);
        $birthDay = (int)strftime('%d', $birthTimestamp);

        $age = $currentYear - $birthYear;

        if ($currentMonth < $birthMonth) {
            $age--;
        } elseif ($currentMonth === $birthMonth) {
            if ($currentDay < $birthDay) {
                $age--;
            }
        }

        return $age;
    }
363798
private function nextTimeout(): ?int
    {
        $time = \microtime(true);
        
        while (!$this->scheduler->isEmpty()) {
            list ($watcher, $scheduled) = $this->scheduler->top();
            
            if ($watcher->enabled && $watcher->scheduled === $scheduled) {
                return (int) \max(0, ($watcher->due - $time) * 1000000);
            }
        }
        
        return null;
    }
409876
protected function getTimestamp()/*# : string */
    {
        $num = bcadd(
            bcmul((microtime(true) - strtotime(static::$epoch)), 100000000),
            $this->getSequence() % 10000
        );
        return substr('00' . static::fromBase10($num, self::BASE16), -15);
    }
237245
public function getDuration()
	{
		$started = (is_null($this->started)) ? new \DateTime('now') : $this->started;
		$stopped = (is_null($this->stopped)) ? new \DateTime('now') : $this->stopped;

		return $started->diff($stopped);
	}
1313078
public function getDOSTimestamp()
    {
        $time = getdate($this->getTimestamp());

        if ($time['year'] < 1980) {
            $time['year']    = 1980;
            $time['mon']     = 1;
            $time['mday']    = 1;
            $time['hours']   = 0;
            $time['minutes'] = 0;
            $time['seconds'] = 0;
        }

        return (($time['year'] - 1980) << 25)
               | ($time['mon'] << 21)
               | ($time['mday'] << 16)
               | ($time['hours'] << 11)
               | ($time['minutes'] << 5)
               | ($time['seconds'] >> 1);
    }
1187635
public function getDuration()
    {
        if (null === $this->data) {
            return 0;
        }

        $time = 0;
        foreach ($this->data as $data) {
            $time += $data['duration'];
        }

        return $time;
    }
1131976
public function getTime()
    {
        $time = 0;
        foreach ($this->data['queries'] as $query) {
            $time += (float) $query['time'];
        }

        return $time;
    }
909314
private function getTimezonesHavingNewDaySinceLastRun()
    {
        $timestamp = $this->lastSuccessRunTimestamp;
        $uniqueTimezones = APISitesManager::getInstance()->getUniqueSiteTimezones();
        $timezoneToProcess = array();
        foreach ($uniqueTimezones as &$timezone) {
            $processedDateInTz = Date::factory((int)$timestamp, $timezone);
            $currentDateInTz = Date::factory('now', $timezone);

            if ($processedDateInTz->toString() != $currentDateInTz->toString()) {
                $timezoneToProcess[] = $timezone;
            }
        }
        return $timezoneToProcess;
    }
771964
public function next():int
    {
        $timestamp = $this->milliTime();
        if ($timestamp < $this->_lastTimestamp) {
            throw new Exception(sprintf("Clock moved backwards.  Refusing to generate id for %d milliseconds", $this->_lastTimestamp - $timestamp));
        }
        if ($this->_lastTimestamp == $timestamp) {
            $this->_sequence = ($this->_sequence + 1) & self::SEQUENCE_MASK;
            if ($this->_sequence == 0) {
                $timestamp = $this->waitNextMilli($this->_lastTimestamp);
            }
        } else {
            $this->_sequence = 0;
        }
        $this->_lastTimestamp = $timestamp;
        return (($timestamp - $this->epoch) << self::TIMESTAMP_LEFT_SHIFT)
            | ($this->dataCenterId << self::DATA_CENTER_ID_SHIFT)
            | ($this->workerId << self::WORKER_ID_SHIFT)
            | $this->_sequence;
    }
449343
public function currentUtcDatetime()
    {
        if ($this->timeFormat === static::$timeFormatDatetime) {
            return gmdate('Y-m-d H:i:s');
        }
        if ($this->timeFormat === static::$timeFormatTimestamp) {
            return time();
        }
        return null;
    }
666990
public function getBanActiveTimestamp(): int
    {
        $this->db->qb([
            'table' => 'core_bans',
            'fields' => 'logstamp',
            'filter' => 'ip=:ip AND code=0',
            'params' => [
                ':ip' => $this->ip
            ],
            'order' => 'logstamp DESC',
            'limit' => 1
        ]);

        $data = $this->db->value();

        return $data ? $data : 0;
    }
775458
public function getScheduleDelay()
    {
        $value = $this->getSchedule();
        if (null === $value) {
            return -1;
        }

        $object = CronExpression::factory($value);

        $format = 'Y-m-d H:i:s';
        $timeFirst = strtotime($object->getNextRunDate()->format($format));
        $timeSecond = strtotime(date($format));

        return (int) $timeFirst - $timeSecond;
    }