Analysable end timestamp.

@return int
428594
public function get_end() {
        if (!empty($this->end)) {
            return $this->end;
        }

        $this->end = time();
        return $this->end;
    }
426979
public function getLastAccessedAt() {
		$timestamp = fileatime($this->pathname);
		$time = new DateTime();
		$time->setTimestamp($timestamp);
		return $time;
	}
807778
public function getLast()
    {
        $last = null;

        if (count($this->objects) > 0) {
            $last = end($this->objects);
        }

        return $last;
    }
750269
public function getTtl() {

        if ( is_null($this->expiration) ) return null;

        if ( $this->expiration === 0 ) return 0;

        $now = new DateTime("now");

        if ( $now > $this->expiration ) return -1;

        return (int) $now->diff($this->expiration)->format("%r%s");

    }
139508
public function getLastModified()
    {
        if (!count($this->assets)) {
            return;
        }

        $mtime = 0;
        foreach ($this as $asset) {
            $assetMtime = $asset->getLastModified();
            if ($assetMtime > $mtime) {
                $mtime = $assetMtime;
            }
        }

        return $mtime;
    }
568879
public function isExpired()
    {
        $curTime = $this->timer['now'];
        $maxTime = $this->timer['last'] + $this->_lifetime;

        return ($maxTime < $curTime);
    }
631431
public function getEndTime()
    {
        $count = \count($this->periods);

        return $count ? $this->periods[$count - 1]->getEndTime() : 0;
    }
49992
public function timestamp(): int
    {
        $request = $this->client->createRequest(Api::GET, $this->getApiUrn(['timestamp']));
        $response = $this->client->send($request);

        return (int)$response->getBody()->getContents();
    }
732342
public function getCreatedAtTimestamp(): ?int
    {
        if (!$this->hasCreatedAt()) {
            return null;
        }

	    $timestamp = strtotime($this->getCreatedAt() . 'UTC');

	    if ($timestamp === false) {
		    throw new Exception("Unable to get timestamp from \"{$this->getCreatedAt()}\"");
	    }

	    return $timestamp;
    }
1075662
public function isTemporal()
    {
        return in_array($this->type, [
            PropelTypes::TIMESTAMP,
            PropelTypes::DATE,
            PropelTypes::TIME,
            PropelTypes::BU_DATE,
            PropelTypes::BU_TIMESTAMP,
        ]);
    }
154999
public function endOfMonth() {
        
        $lastDay = static::getMonthLength($this->month, $this->year);
        
        return $this->day($lastDay)->endOfDay();
    }
412104
private function checkExpiration()
    {
        if (!$this->hasLifetime) {
            return;
        }

        if (!isset($this->payload['exp']) || !is_numeric($this->payload['exp'])) {
            return $this->state = self::INVALID;
        }

        if ($this->clockSkew <= (new \DateTime())->format('U') - $this->payload['exp']) {
            $this->state = self::EXPIRED;
        }
    }
590729
public function getTimestamp()
	{
		if (!isset($this->timestamp))
		{
			$this->timestamp = $this->hasAdapterOrFail()->adapter->getTimestamp($this->getPath());
		}

		return $this->timestamp;
	}
1059327
public function getTimestamp(): int
    {
        $supportedClasses = implode(
            ', ',
            [
                '\MongoTimestamp',
                '\MongoDate',
                '\MongoDB\BSON\Timestamp',
                '\MongoDB\BSON\UTCDateTime',
                '\DateTimeInterface',
            ]
        );

        if (!$this->t || !is_object($this->t)) {
            throw new \DomainException(
                'The timestamp to normalise must be one of ' . $supportedClasses . ' but it is not an object'
            );
        }

        switch (get_class($this->t)) {
            case 'MongoTimestamp':
                return (int) $this->t->__toString();

            case 'MongoDate':
                return $this->t->sec;

            case 'MongoDB\BSON\Timestamp':
                return $this->t->getTimestamp();

            case 'MongoDB\BSON\UTCDateTime':
                return (int) $this->t->toDateTime()->format('U');
        }

        if ($this->t instanceof \DateTimeInterface) {
            return $this->t->getTimestamp();
        }

        throw new \DomainException(
            'The normalised timestamp must be one of ' . $supportedClasses
        );
    }
614484
public function guess_end() {
        global $DB;

        if ($this->get_total_logs() === 0) {
            // No way to guess if there are no logs.
            $this->endtime = 0;
            return $this->endtime;
        }

        list($filterselect, $filterparams) = $this->course_students_query_filter('ula');

        // Consider the course open if there are still student accesses.
        $monthsago = time() - (WEEKSECS * 4 * 2);
        $select = $filterselect . ' AND timeaccess > :timeaccess';
        $params = $filterparams + array('timeaccess' => $monthsago);
        $sql = "SELECT DISTINCT timeaccess FROM {user_lastaccess} ula
                  JOIN {enrol} e ON e.courseid = ula.courseid
                  JOIN {user_enrolments} ue ON e.id = ue.enrolid AND ue.userid = ula.userid
                 WHERE $select";
        if ($records = $DB->get_records_sql($sql, $params)) {
            return 0;
        }

        $sql = "SELECT DISTINCT timeaccess FROM {user_lastaccess} ula
                  JOIN {enrol} e ON e.courseid = ula.courseid
                  JOIN {user_enrolments} ue ON e.id = ue.enrolid AND ue.userid = ula.userid
                 WHERE $filterselect AND ula.timeaccess != 0
                 ORDER BY timeaccess DESC";
        $studentlastaccesses = $DB->get_fieldset_sql($sql, $filterparams);
        if (empty($studentlastaccesses)) {
            return 0;
        }
        sort($studentlastaccesses);

        return $this->median($studentlastaccesses);
    }
499892
final public function time() {
		if ($this->dbtype == 'pgsql')
			return $this->query(
				"SELECT EXTRACT('epoch' from CURRENT_TIMESTAMP) AS now"
			)['now'];
		if ($this->dbtype == 'mysql')
			return $this->query(
				"SELECT UNIX_TIMESTAMP() AS now")['now'];
		return $this->query(
			"SELECT strftime('%s', CURRENT_TIMESTAMP) AS now"
		)['now'];
	}
695481
protected function parseTransactionValueTimestamp()
    {
        $results = [];
        if (preg_match('/^:61:([\d]{6})[C|D]/', $this->getCurrentTransactionData(), $results) && !empty($results[1])) {
            return $this->sanitizeTimestamp($results[1]);
        }

        return 0;
    }