Set modification date and time.

@param \DateTimeInterface|string $time

@since 0.1
327127
public function setUpdatedAt($time)
    {
        if ($time instanceof \DateTimeInterface) {
            $time = $time->format(DATE_RFC3339);
        }

        $this->setValue('lastModified', (string) $time);
    }
1321171
public function setDateTime($dateTime)
	{
		$this->registry()->register(self::REGISTRY_DATETIME, $dateTime, true);
		return $this;
	}
539065
public function setDateTime(\DateTimeInterface $dateTime)
    {
        if ($dateTime instanceof \DateTime) {
            $immutable = new \DateTimeImmutable('@'.$dateTime->getTimestamp());
            $dateTime = $immutable->setTimezone($dateTime->getTimezone());
        }
        $this->dateTime = $dateTime;
    }
1370972
public function set_timemodified($timemodified) {
        $filerecord = new stdClass;
        $filerecord->timemodified = $timemodified;
        $this->update($filerecord);
    }
644480
public function setModificationDate($modificationDate = null)
    {
        if (!isset($modificationDate)) {
            $modificationDate = new \DateTime();
        }
        if (is_string($modificationDate)) {
            $modificationDate = new \DateTime($modificationDate);
        }
        $this->modificationDate = $modificationDate;
        return $this;
    }
886109
public function setTimeFrom($date)
    {
        $date = static::instance($date);

        $this->setTime($date->hour, $date->minute, $date->second);

        return $this;
    }
880381
public function setCurrentTime($currentTime)
    {
        $this->items['iat'] = (int) $currentTime;
        $this->items['nbf'] = (int) $currentTime;
        $this->items['exp'] = (int) $currentTime;
    }
240157
protected function convertToDateTime( $time )
    {
        if ( $time instanceof DateTime )
        {
            return clone $time;
        }
        else if ( $time instanceof \DateTime )
        {
            return new DateTime( $time->format( \DateTime::ISO8601 ) );
        }
        else if ( is_numeric( $time ) )
        {
            return new DateTime( '@' . $time );
        }

        return new DateTime( (string) $time );
    }
1148142
public void setMorphTime(float time) {
		int p = (int) time;
		int n = p + 1;
		float offset = time - p;
		
		p = rational(p);
		n = rational(n);
		
		setFrame(p, n, offset);
	}
989844
public function expiresAfter($time)
    {
        $this->expiration = new \DateTime();
        if (is_int($time)) {
            if ($time < 0) {
                $time = new \DateInterval('PT' . abs($time) . 'S');
                $time->invert = 1;
            } else {
                $time = new \DateInterval('PT' . $time . 'S');
            }
        }
        $this->expiration->add($time);
        $this->changed = true;
        return $this;
    }
444956
public function setValue($value)
    {
        if ($value instanceof DateTimeInterface) {
            $this->setDateTime($value);
        } else {
            parent::setValue($value);
        }
    }
136903
public function setEndTime($endTime)
    {
        if ($endTime instanceof \DateTime)
        {
            $endTime = $endTime->format('H:i');
        }

        // deal with "hour-only" input
        if (2 == strlen($endTime))
        {
            $endTime .= ':00';
        }

        $this->end_time = $endTime;
    }
524826
public static void setLocal(String time) {
		SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
		Date result = null;
		try {
			result = sdf.parse(time);
		}
		catch (ParseException pex) {
			throw new RuntimeException("Time is not parseable (" + time + ")", pex);
		}
		setClock(Clock.fixed(result.toInstant(), ZoneId.systemDefault()));
	}
719572
private function setSessionData(int $time): void
    {
        $this->id = \session_id();
        $this->data['time'] = $time;
        $this->data['expire'] = $this->expire;
        $this->status = \session_status();
    }
729947
public function setTimestamp($timestamp = null)
    {
        $this->timestamp = (string)($timestamp ?? $this->modified());

        return $this;
    }
1278324
public function setEndTime(float $time){
        if($time <= $this->start){
            throw new \LogicException;
        }

        $this->end  = $time;

        $this->timeline->setExecutionTime($this->end - $this->start);
    }
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));
        }
    }