You are here

constant REQUEST_TIME in Drupal 10

Same name and namespace in other branches
  1. 8 core/includes/bootstrap.inc \REQUEST_TIME
  2. 7 includes/bootstrap.inc \REQUEST_TIME
  3. 9 core/includes/bootstrap.inc \REQUEST_TIME

Time of the current request in seconds elapsed since the Unix Epoch.

This differs from $_SERVER['REQUEST_TIME'], which is stored as a float since PHP 5.4.0. Float timestamps confuse most PHP functions (including date_create()).

Deprecated

in drupal:8.3.0 and is removed from drupal:10.0.0. Use \Drupal::time()->getRequestTime();

See also

http://php.net/manual/reserved.variables.server.php

http://php.net/manual/function.time.php

https://www.drupal.org/node/2785211

138 uses of REQUEST_TIME
AliasManager::getRequestTime in core/modules/path_alias/src/AliasManager.php
Wrapper method for REQUEST_TIME constant.
ApcuBackend::invalidateAll in core/lib/Drupal/Core/Cache/ApcuBackend.php
ApcuBackend::invalidateMultiple in core/lib/Drupal/Core/Cache/ApcuBackend.php
ApcuBackend::prepareItem in core/lib/Drupal/Core/Cache/ApcuBackend.php
Prepares a cached item.
AssertViewsCacheTagsTrait::assertViewsCacheTags in core/modules/views/src/Tests/AssertViewsCacheTagsTrait.php
Asserts a view's result & render cache items' cache tags.

... See full list

File

core/includes/bootstrap.inc, line 54
Functions that need to be loaded on every Drupal request.

Code

define('REQUEST_TIME', (int) $_SERVER['REQUEST_TIME']);