Update the timemodifiedoffline attempt field.
This function should be used only when web services are being used.

@param int $time time stamp
@return boolean false if the field is not updated because web services aren't being used.
@since Moodle 3.2
517936
public function set_offline_modified_time($time) {
        global $DB;

        // Update the timemodifiedoffline field only if web services are being used.
        if (WS_SERVER) {
            $this->attempt->timemodifiedoffline = $time;
            return true;
        }
        return false;
    }
1090237
public void update(VectorTimestamp<T> timestamp) {
    VectorTimestamp<T> currentTimestamp = vector.get(timestamp.identifier());
    if (currentTimestamp == null || currentTimestamp.value() < timestamp.value()) {
      vector.put(timestamp.identifier(), timestamp);
    }
  }
1141053
public function withTimestamps($createdAt = null, $updatedAt = null)
    {
        return $this->withPivot($createdAt ?: $this->createdAt(), $updatedAt ?: $this->updatedAt());
    }
325470
public function process_abandon($timestamp, $studentisonline) {
        global $DB;

        $transaction = $DB->start_delegated_transaction();
        $this->attempt->timemodified = $timestamp;
        $this->attempt->state = self::ABANDONED;
        $this->attempt->timecheckstate = null;
        $DB->update_record('quiz_attempts', $this->attempt);

        $this->fire_state_transition_event('\mod_quiz\event\attempt_abandoned', $timestamp);

        $transaction->allow_commit();
    }
936232
public function setTimestamp($timestamp)
    {
        $this->timestamp = is_numeric($timestamp) ? $timestamp : strtotime($timestamp);

        return $this;
    }
784275
public function update_timecheckstate($time) {
        global $DB;
        if ($this->attempt->timecheckstate !== $time) {
            $this->attempt->timecheckstate = $time;
            $DB->set_field('quiz_attempts', 'timecheckstate', $time, array('id' => $this->attempt->id));
        }
    }
797915
public static function isTimestamp($timestamp)
    {
        if (!$timestamp || !is_numeric($timestamp) || 10 !== \strlen($timestamp)) {
            return false;
        }

        return date('Ymd', $timestamp) ? true : false;
    }
502438
private function updateTime()
    {
        // Date string generation is (relatively) expensive. Since we only need HTTP
        // dates at a granularity of one second we're better off to generate this
        // information once per second and cache it.
        $this->currentTime = \time();
        $this->currentHttpDate = \gmdate("D, d M Y H:i:s", $this->currentTime) . " GMT";

        foreach ($this->callbacks as $callback) {
            $callback($this->currentTime, $this->currentHttpDate);
        }
    }
854370
protected function timestampUpdate()
    {
        $this->updated = date('Y-m-d H:i:s');
        $this->id || $this->created = $this->updated;
    }
454341
public function setExpireAtMilliSeconds(int $timestamp): bool
    {
        return $this->handle->pExpireAt($this->name, $timestamp);
    }
774053
protected function timestampHasExpired(int $timestamp): bool
    {
        $date = Carbon::createFromTimestamp($timestamp, 'UTC');
        $start = Carbon::now('UTC')->subSeconds($this->timestampExpires);
        $end = Carbon::now('UTC');

        return !$date->between($start, $end);
    }
1134116
public function convertMongoTimestamp()
    {
        $this->createdAt = ($this->createdAt instanceof \MongoTimestamp) ? $this->createdAt->sec : $this->createdAt;
        $this->updatedAt = ($this->updatedAt instanceof \MongoTimestamp) ? $this->updatedAt->sec : $this->updatedAt;
    }
180155
public static function isTimestamp($timestamp)
    {
        if (is_bool($timestamp) || !is_scalar($timestamp)) {
            return false;
        }
        return ((string)(int)$timestamp === (string)$timestamp)
        && ($timestamp <= PHP_INT_MAX)
        && ($timestamp >= ~PHP_INT_MAX);
    }
557374
private function updateExtraTime()
    {
        $testSession = $this->getTestSession();
        if ($testSession instanceof TestSession) {
            $timer = $testSession->getTimer();
            $timerTarget = $testSession->getTimerTarget();
        } else {
            $timerTarget = TimePoint::TARGET_SERVER;
            $qtiTimerFactory = $this->getServiceLocator()->get(QtiTimerFactory::SERVICE_ID);
            $timer = $qtiTimerFactory->getTimer($this->deliveryExecution->getIdentifier(), $this->deliveryExecution->getUserIdentifier());
        }

        $deliveryExecutionManager = $this->getServiceLocator()->get(DeliveryExecutionManagerService::SERVICE_ID);
        $maxTimeSeconds = $deliveryExecutionManager->getTimeLimits($testSession);

        $data = $this->get();
        $oldConsumedExtraTime = isset($data[DeliveryMonitoringService::CONSUMED_EXTRA_TIME]) ? $data[DeliveryMonitoringService::CONSUMED_EXTRA_TIME] : 0;
        $consumedExtraTime = max($oldConsumedExtraTime, $timer->getConsumedExtraTime(null, $maxTimeSeconds, $timerTarget));

        $this->addValue(DeliveryMonitoringService::EXTRA_TIME, $timer->getExtraTime($maxTimeSeconds), true);
        $this->addValue(DeliveryMonitoringService::CONSUMED_EXTRA_TIME, $consumedExtraTime, true);
    }
283377
public function isFresh($path, $timestamp)
    {
        if (!isset($this->features[$path])) {
            return false;
        }

        return $this->timestamps[$path] > $timestamp;
    }
493683
function setTimeOfDay( $timestamp )
    {
        $this->Time = $timestamp % self::SECONDS_A_DAY;
        if ( $this->Time < 0 )
            $this->Time += self::SECONDS_A_DAY;
        $this->IsValid = $this->Time >= 0;
    }
1024637
public function log($msg, $timestamp = true)
    {
        if ($timestamp) {
            $timestamp = strftime("%Y-%m-%d %H:%M:%S");
            $msg = "[{$timestamp}] {$msg}";
        }
        $this->addResult($msg);
        if ($this->verbose) echo $msg . PHP_EOL;
    }