function Time::getRequestTime
Overrides TimeInterface::getRequestTime
File
-
core/
lib/ Drupal/ Component/ Datetime/ Time.php, line 41
Class
- Time
- Provides a class for obtaining system time.
Namespace
Drupal\Component\DatetimeCode
public function getRequestTime() {
$request = $this->requestStack ? $this->requestStack
->getCurrentRequest() : NULL;
if ($request) {
return $request->server
->get('REQUEST_TIME');
}
// If this is called prior to the request being pushed to the stack fallback
// to built-in globals (if available) or the system time.
return $_SERVER['REQUEST_TIME'] ?? $this->getProxyRequestTime();
}