diff --git a/core/lib/Drupal/Core/Asset/CssCollectionOptimizer.php b/core/lib/Drupal/Core/Asset/CssCollectionOptimizer.php
index 26ed07f79e..f241a5f188 100644
--- a/core/lib/Drupal/Core/Asset/CssCollectionOptimizer.php
+++ b/core/lib/Drupal/Core/Asset/CssCollectionOptimizer.php
@@ -192,7 +192,7 @@ public function deleteAll() {
 
     $delete_stale = function ($uri) {
       // Default stale file threshold is 30 days.
-      if (REQUEST_TIME - filemtime($uri) > \Drupal::config('system.performance')->get('stale_file_threshold')) {
+      if (\Drupal::time()->getRequestTime() - filemtime($uri) > \Drupal::config('system.performance')->get('stale_file_threshold')) {
         $this->fileSystem->delete($uri);
       }
     };
diff --git a/core/lib/Drupal/Core/Asset/JsCollectionOptimizer.php b/core/lib/Drupal/Core/Asset/JsCollectionOptimizer.php
index dc66652b6c..d591a0e8a1 100644
--- a/core/lib/Drupal/Core/Asset/JsCollectionOptimizer.php
+++ b/core/lib/Drupal/Core/Asset/JsCollectionOptimizer.php
@@ -194,7 +194,7 @@ public function deleteAll() {
     $this->state->delete('system.js_cache_files');
     $delete_stale = function ($uri) {
       // Default stale file threshold is 30 days.
-      if (REQUEST_TIME - filemtime($uri) > \Drupal::config('system.performance')->get('stale_file_threshold')) {
+      if (\Drupal::time()->getRequestTime() - filemtime($uri) > \Drupal::config('system.performance')->get('stale_file_threshold')) {
         $this->fileSystem->delete($uri);
       }
     };
diff --git a/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php b/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php
index 99d0e14f54..19314c3aa9 100644
--- a/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php
+++ b/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php
@@ -40,11 +40,12 @@ public function render(array $js_assets) {
     $elements = [];
 
     // A dummy query-string is added to filenames, to gain control over
-    // browser-caching. The string changes on every update or full cache
-    // flush, forcing browsers to load a new copy of the files, as the
-    // URL changed. Files that should not be cached get REQUEST_TIME as
-    // query-string instead, to enforce reload on every page request.
-    $default_query_string = $this->state->get('system.css_js_query_string', '0');
+    // browser-caching. The string changes on every update or full cache flush,
+    // forcing browsers to load a new copy of the files, as the URL changed.
+    // Files that should not be cached get
+    // \Drupal::time()->getRequestTime() as query-string instead,
+    // to enforce reload on every page request.
+    $default_query_string = $this->state->get('system.css_js_query_string') ?: '0';
 
     // Defaults for each SCRIPT element.
     $element_defaults = [
@@ -78,7 +79,7 @@ public function render(array $js_assets) {
           // Only add the cache-busting query string if this isn't an aggregate
           // file.
           if (!isset($js_asset['preprocessed'])) {
-            $element['#attributes']['src'] .= $query_string_separator . ($js_asset['cache'] ? $query_string : REQUEST_TIME);
+            $element['#attributes']['src'] .= $query_string_separator . ($js_asset['cache'] ? $query_string : \Drupal::time()->getRequestTime());
           }
           break;
 
diff --git a/core/lib/Drupal/Core/Batch/BatchStorage.php b/core/lib/Drupal/Core/Batch/BatchStorage.php
index 69efc1b9bb..097d26c469 100644
--- a/core/lib/Drupal/Core/Batch/BatchStorage.php
+++ b/core/lib/Drupal/Core/Batch/BatchStorage.php
@@ -109,7 +109,7 @@ public function cleanup() {
     try {
       // Cleanup the batch table and the queue for failed batches.
       $this->connection->delete('batch')
-        ->condition('timestamp', REQUEST_TIME - 864000, '<')
+        ->condition('timestamp', \Drupal::time()->getRequestTime() - 864000, '<')
         ->execute();
     }
     catch (\Exception $e) {
@@ -152,7 +152,7 @@ protected function doCreate(array $batch) {
     $this->connection->insert('batch')
       ->fields([
         'bid' => $batch['id'],
-        'timestamp' => REQUEST_TIME,
+        'timestamp' => \Drupal::time()->getRequestTime(),
         'token' => $this->csrfToken->get($batch['id']),
         'batch' => serialize($batch),
       ])
diff --git a/core/lib/Drupal/Core/Cache/ApcuBackend.php b/core/lib/Drupal/Core/Cache/ApcuBackend.php
index 6014fb8bff..ad04efce8b 100644
--- a/core/lib/Drupal/Core/Cache/ApcuBackend.php
+++ b/core/lib/Drupal/Core/Cache/ApcuBackend.php
@@ -145,7 +145,7 @@ protected function prepareItem($cache, $allow_invalid) {
     $cache->tags = $cache->tags ? explode(' ', $cache->tags) : [];
 
     // Check expire time.
-    $cache->valid = $cache->expire == Cache::PERMANENT || $cache->expire >= REQUEST_TIME;
+    $cache->valid = $cache->expire == Cache::PERMANENT || $cache->expire >= \Drupal::time()->getRequestTime();
 
     // Check if invalidateTags() has been called with any of the entry's tags.
     if (!$this->checksumProvider->isValid($cache->checksum, $cache->tags)) {
@@ -235,7 +235,7 @@ public function invalidate($cid) {
    */
   public function invalidateMultiple(array $cids) {
     foreach ($this->getMultiple($cids) as $cache) {
-      $this->set($cache->cid, $cache, REQUEST_TIME - 1);
+      $this->set($cache->cid, $cache, \Drupal::time()->getRequestTime() - 1);
     }
   }
 
@@ -245,7 +245,7 @@ public function invalidateMultiple(array $cids) {
   public function invalidateAll() {
     foreach ($this->getAll() as $data) {
       $cid = str_replace($this->binPrefix, '', $data['key']);
-      $this->set($cid, $data['value'], REQUEST_TIME - 1);
+      $this->set($cid, $data['value'], \Drupal::time()->getRequestTime() - 1);
     }
   }
 
diff --git a/core/lib/Drupal/Core/Cache/DatabaseBackend.php b/core/lib/Drupal/Core/Cache/DatabaseBackend.php
index cb8b099c18..16ec1297b5 100644
--- a/core/lib/Drupal/Core/Cache/DatabaseBackend.php
+++ b/core/lib/Drupal/Core/Cache/DatabaseBackend.php
@@ -151,7 +151,7 @@ protected function prepareItem($cache, $allow_invalid) {
     $cache->tags = $cache->tags ? explode(' ', $cache->tags) : [];
 
     // Check expire time.
-    $cache->valid = $cache->expire == Cache::PERMANENT || $cache->expire >= REQUEST_TIME;
+    $cache->valid = $cache->expire == Cache::PERMANENT || $cache->expire >= \Drupal::time()->getRequestTime();
 
     // Check if invalidateTags() has been called with any of the items's tags.
     if (!$this->checksumProvider->isValid($cache->checksum, $cache->tags)) {
@@ -336,7 +336,7 @@ public function invalidateMultiple(array $cids) {
       // Update in chunks when a large array is passed.
       foreach (array_chunk($cids, 1000) as $cids_chunk) {
         $this->connection->update($this->bin)
-          ->fields(['expire' => REQUEST_TIME - 1])
+          ->fields(['expire' => \Drupal::time()->getRequestTime() - 1])
           ->condition('cid', $cids_chunk, 'IN')
           ->execute();
       }
@@ -352,7 +352,7 @@ public function invalidateMultiple(array $cids) {
   public function invalidateAll() {
     try {
       $this->connection->update($this->bin)
-        ->fields(['expire' => REQUEST_TIME - 1])
+        ->fields(['expire' => \Drupal::time()->getRequestTime() - 1])
         ->execute();
     }
     catch (\Exception $e) {
@@ -383,7 +383,7 @@ public function garbageCollection() {
 
       $this->connection->delete($this->bin)
         ->condition('expire', Cache::PERMANENT, '<>')
-        ->condition('expire', REQUEST_TIME, '<')
+        ->condition('expire', \Drupal::time()->getRequestTime(), '<')
         ->execute();
     }
     catch (\Exception $e) {
diff --git a/core/lib/Drupal/Core/Cache/MemoryBackend.php b/core/lib/Drupal/Core/Cache/MemoryBackend.php
index d402d70b54..e1899ddfb1 100644
--- a/core/lib/Drupal/Core/Cache/MemoryBackend.php
+++ b/core/lib/Drupal/Core/Cache/MemoryBackend.php
@@ -196,12 +196,12 @@ public function removeBin() {
   }
 
   /**
-   * Wrapper method for REQUEST_TIME constant.
+   * Wrapper method for $_SERVER['REQUEST_TIME'].
    *
    * @return int
    */
   protected function getRequestTime() {
-    return defined('REQUEST_TIME') ? REQUEST_TIME : (int) $_SERVER['REQUEST_TIME'];
+    return \Drupal::hasContainer() ? \Drupal::time()->getRequestTime() : (int) $_SERVER['REQUEST_TIME'];
   }
 
   /**
diff --git a/core/lib/Drupal/Core/Cache/PhpBackend.php b/core/lib/Drupal/Core/Cache/PhpBackend.php
index e4628781b2..174360f45f 100644
--- a/core/lib/Drupal/Core/Cache/PhpBackend.php
+++ b/core/lib/Drupal/Core/Cache/PhpBackend.php
@@ -126,7 +126,7 @@ protected function prepareItem($cache, $allow_invalid) {
     }
 
     // Check expire time.
-    $cache->valid = $cache->expire == Cache::PERMANENT || $cache->expire >= REQUEST_TIME;
+    $cache->valid = $cache->expire == Cache::PERMANENT || $cache->expire >= \Drupal::time()->getRequestTime();
 
     // Check if invalidateTags() has been called with any of the item's tags.
     if (!$this->checksumProvider->isValid($cache->checksum, $cache->tags)) {
@@ -195,7 +195,7 @@ public function invalidate($cid) {
    */
   protected function invalidatebyHash($cidhash) {
     if ($item = $this->getByHash($cidhash)) {
-      $item->expire = REQUEST_TIME - 1;
+      $item->expire = \Drupal::time()->getRequestTime() - 1;
       $this->writeItem($cidhash, $item);
     }
   }
diff --git a/core/lib/Drupal/Core/Datetime/DateHelper.php b/core/lib/Drupal/Core/Datetime/DateHelper.php
index 168ef62740..a5feebf1d2 100644
--- a/core/lib/Drupal/Core/Datetime/DateHelper.php
+++ b/core/lib/Drupal/Core/Datetime/DateHelper.php
@@ -291,10 +291,10 @@ public static function weekDaysOrdered($weekdays) {
   public static function years($min = 0, $max = 0, $required = FALSE) {
     // Ensure $min and $max are valid values.
     if (empty($min)) {
-      $min = intval(date('Y', REQUEST_TIME) - 3);
+      $min = intval(date('Y', \Drupal::time()->getRequestTime()) - 3);
     }
     if (empty($max)) {
-      $max = intval(date('Y', REQUEST_TIME) + 3);
+      $max = intval(date('Y', \Drupal::time()->getRequestTime()) + 3);
     }
     $none = ['' => ''];
     $range = range($min, $max);
diff --git a/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php
index 747262c849..9bcff72aaa 100644
--- a/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php
+++ b/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php
@@ -248,8 +248,8 @@ protected function setResponseCacheable(Response $response, Request $request) {
     // In order to support HTTP cache-revalidation, ensure that there is a
     // Last-Modified and an ETag header on the response.
     if (!$response->headers->has('Last-Modified')) {
-      $timestamp = REQUEST_TIME;
-      $response->setLastModified(new \DateTime(gmdate(DateTimePlus::RFC7231, REQUEST_TIME)));
+      $timestamp = \Drupal::time()->getRequestTime();
+      $response->setLastModified(new \DateTime(gmdate(DateTimePlus::RFC7231, \Drupal::time()->getRequestTime())));
     }
     else {
       $timestamp = $response->getLastModified()->getTimestamp();
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/TimestampFormatter.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/TimestampFormatter.php
index cbc6d7ddd5..55463da624 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/TimestampFormatter.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/TimestampFormatter.php
@@ -106,7 +106,7 @@ public function settingsForm(array $form, FormStateInterface $form_state) {
     $date_formats = [];
 
     foreach ($this->dateFormatStorage->loadMultiple() as $machine_name => $value) {
-      $date_formats[$machine_name] = $this->t('@name format: @date', ['@name' => $value->label(), '@date' => $this->dateFormatter->format(REQUEST_TIME, $machine_name)]);
+      $date_formats[$machine_name] = $this->t('@name format: @date', ['@name' => $value->label(), '@date' => $this->dateFormatter->format(\Drupal::time()->getRequestTime(), $machine_name)]);
     }
 
     $date_formats['custom'] = $this->t('Custom');
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/ChangedItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/ChangedItem.php
index bd2e129f29..9e737758ab 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/ChangedItem.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/ChangedItem.php
@@ -30,7 +30,7 @@ public function preSave() {
 
     // Set the timestamp to request time if it is not set.
     if (!$this->value) {
-      $this->value = REQUEST_TIME;
+      $this->value = \Drupal::time()->getRequestTime();
     }
     else {
       // On an existing entity translation, the changed timestamp will only be
@@ -47,7 +47,7 @@ public function preSave() {
       if (!$entity->isNew() && $original && $original->hasTranslation($langcode)) {
         $original_value = $original->getTranslation($langcode)->get($this->getFieldDefinition()->getName())->value;
         if ($this->value == $original_value && $entity->hasTranslationChanges()) {
-          $this->value = REQUEST_TIME;
+          $this->value = \Drupal::time()->getRequestTime();
         }
       }
     }
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/CreatedItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/CreatedItem.php
index da2e2a7450..78a66a7f84 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/CreatedItem.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/CreatedItem.php
@@ -22,7 +22,7 @@ class CreatedItem extends TimestampItem {
   public function applyDefaultValue($notify = TRUE) {
     parent::applyDefaultValue($notify);
     // Created fields default to the current timestamp.
-    $this->setValue(['value' => REQUEST_TIME], $notify);
+    $this->setValue(['value' => \Drupal::time()->getRequestTime()], $notify);
     return $this;
   }
 
diff --git a/core/lib/Drupal/Core/Flood/DatabaseBackend.php b/core/lib/Drupal/Core/Flood/DatabaseBackend.php
index afb295546c..80fcdacf06 100644
--- a/core/lib/Drupal/Core/Flood/DatabaseBackend.php
+++ b/core/lib/Drupal/Core/Flood/DatabaseBackend.php
@@ -83,8 +83,8 @@ protected function doInsert($name, $window, $identifier) {
       ->fields([
         'event' => $name,
         'identifier' => $identifier,
-        'timestamp' => REQUEST_TIME,
-        'expiration' => REQUEST_TIME + $window,
+        'timestamp' => \Drupal::time()->getRequestTime(),
+        'expiration' => \Drupal::time()->getRequestTime() + $window,
       ])
       ->execute();
   }
@@ -118,7 +118,7 @@ public function isAllowed($name, $threshold, $window = 3600, $identifier = NULL)
       $number = $this->connection->select(static::TABLE_NAME, 'f')
         ->condition('event', $name)
         ->condition('identifier', $identifier)
-        ->condition('timestamp', REQUEST_TIME - $window, '>')
+        ->condition('timestamp', \Drupal::time()->getRequestTime() - $window, '>')
         ->countQuery()
         ->execute()
         ->fetchField();
@@ -136,7 +136,7 @@ public function isAllowed($name, $threshold, $window = 3600, $identifier = NULL)
   public function garbageCollection() {
     try {
       $return = $this->connection->delete(static::TABLE_NAME)
-        ->condition('expiration', REQUEST_TIME, '<')
+        ->condition('expiration', \Drupal::time()->getRequestTime(), '<')
         ->execute();
     }
     catch (\Exception $e) {
diff --git a/core/lib/Drupal/Core/Flood/MemoryBackend.php b/core/lib/Drupal/Core/Flood/MemoryBackend.php
index 9899e35e7e..b60ec8494f 100644
--- a/core/lib/Drupal/Core/Flood/MemoryBackend.php
+++ b/core/lib/Drupal/Core/Flood/MemoryBackend.php
@@ -38,8 +38,8 @@ public function register($name, $window = 3600, $identifier = NULL) {
     if (!isset($identifier)) {
       $identifier = $this->requestStack->getCurrentRequest()->getClientIp();
     }
-    // We can't use REQUEST_TIME here, because that would not guarantee
-    // uniqueness.
+    // We can't use \Drupal::time()->getRequestTime() here, because that would
+    // not guarantee uniqueness.
     $time = microtime(TRUE);
     $this->events[$name][$identifier][$time + $window] = $time;
   }
diff --git a/core/lib/Drupal/Core/KeyValueStore/DatabaseStorageExpirable.php b/core/lib/Drupal/Core/KeyValueStore/DatabaseStorageExpirable.php
index 86d3dabc53..8eba51ffea 100644
--- a/core/lib/Drupal/Core/KeyValueStore/DatabaseStorageExpirable.php
+++ b/core/lib/Drupal/Core/KeyValueStore/DatabaseStorageExpirable.php
@@ -36,7 +36,7 @@ public function has($key) {
     return (bool) $this->connection->query('SELECT 1 FROM {' . $this->connection->escapeTable($this->table) . '} WHERE collection = :collection AND name = :key AND expire > :now', [
       ':collection' => $this->collection,
       ':key' => $key,
-      ':now' => REQUEST_TIME,
+      ':now' => \Drupal::time()->getRequestTime(),
     ])->fetchField();
   }
 
@@ -47,7 +47,7 @@ public function getMultiple(array $keys) {
     $values = $this->connection->query(
       'SELECT name, value FROM {' . $this->connection->escapeTable($this->table) . '} WHERE expire > :now AND name IN ( :keys[] ) AND collection = :collection',
       [
-        ':now' => REQUEST_TIME,
+        ':now' => \Drupal::time()->getRequestTime(),
         ':keys[]' => $keys,
         ':collection' => $this->collection,
       ])->fetchAllKeyed();
@@ -62,7 +62,7 @@ public function getAll() {
       'SELECT name, value FROM {' . $this->connection->escapeTable($this->table) . '} WHERE collection = :collection AND expire > :now',
       [
         ':collection' => $this->collection,
-        ':now' => REQUEST_TIME,
+        ':now' => \Drupal::time()->getRequestTime(),
       ])->fetchAllKeyed();
     return array_map([$this->serializer, 'decode'], $values);
   }
@@ -78,7 +78,7 @@ public function setWithExpire($key, $value, $expire) {
       ])
       ->fields([
         'value' => $this->serializer->encode($value),
-        'expire' => REQUEST_TIME + $expire,
+        'expire' => \Drupal::time()->getRequestTime() + $expire,
       ])
       ->execute();
   }
diff --git a/core/lib/Drupal/Core/KeyValueStore/KeyValueDatabaseExpirableFactory.php b/core/lib/Drupal/Core/KeyValueStore/KeyValueDatabaseExpirableFactory.php
index f9c9b4c17a..abc213a1fa 100644
--- a/core/lib/Drupal/Core/KeyValueStore/KeyValueDatabaseExpirableFactory.php
+++ b/core/lib/Drupal/Core/KeyValueStore/KeyValueDatabaseExpirableFactory.php
@@ -59,7 +59,7 @@ public function get($collection) {
    */
   public function garbageCollection() {
     $this->connection->delete('key_value_expire')
-      ->condition('expire', REQUEST_TIME, '<')
+      ->condition('expire', \Drupal::time()->getRequestTime(), '<')
       ->execute();
   }
 
diff --git a/core/lib/Drupal/Core/Path/AliasManager.php b/core/lib/Drupal/Core/Path/AliasManager.php
index 5673f6627b..495ef82a20 100644
--- a/core/lib/Drupal/Core/Path/AliasManager.php
+++ b/core/lib/Drupal/Core/Path/AliasManager.php
@@ -332,12 +332,12 @@ protected function pathAliasWhitelistRebuild($path = NULL) {
   }
 
   /**
-   * Wrapper method for REQUEST_TIME constant.
+   * Wrapper method for \Drupal::time()->getRequestTime().
    *
    * @return int
    */
   protected function getRequestTime() {
-    return defined('REQUEST_TIME') ? REQUEST_TIME : (int) $_SERVER['REQUEST_TIME'];
+    return \Drupal::hasContainer() ? \Drupal::time()->getRequestTime() : (int) $_SERVER['REQUEST_TIME'];
   }
 
 }
diff --git a/core/lib/Drupal/Core/Queue/DatabaseQueue.php b/core/lib/Drupal/Core/Queue/DatabaseQueue.php
index 1d0621e0e5..471316ba49 100644
--- a/core/lib/Drupal/Core/Queue/DatabaseQueue.php
+++ b/core/lib/Drupal/Core/Queue/DatabaseQueue.php
@@ -87,8 +87,9 @@ protected function doCreateItem($data) {
       ->fields([
         'name' => $this->name,
         'data' => serialize($data),
-        // We cannot rely on REQUEST_TIME because many items might be created
-        // by a single request which takes longer than 1 second.
+        // We cannot rely on \Drupal::time()->getRequestTime()
+        // because many items might be created by a single request which takes
+        // longer than 1 second.
         'created' => time(),
       ]);
     // Return the new serial ID, or FALSE on failure.
@@ -214,7 +215,7 @@ public function garbageCollection() {
     try {
       // Clean up the queue for failed batches.
       $this->connection->delete(static::TABLE_NAME)
-        ->condition('created', REQUEST_TIME - 864000, '<')
+        ->condition('created', \Drupal::time()->getRequestTime() - 864000, '<')
         ->condition('name', 'drupal_batch:%', 'LIKE')
         ->execute();
 
@@ -225,7 +226,7 @@ public function garbageCollection() {
           'expire' => 0,
         ])
         ->condition('expire', 0, '<>')
-        ->condition('expire', REQUEST_TIME, '<')
+        ->condition('expire', \Drupal::time()->getRequestTime(), '<')
         ->execute();
     }
     catch (\Exception $e) {
diff --git a/core/lib/Drupal/Core/Session/SessionHandler.php b/core/lib/Drupal/Core/Session/SessionHandler.php
index 784042aa68..0213060ac7 100644
--- a/core/lib/Drupal/Core/Session/SessionHandler.php
+++ b/core/lib/Drupal/Core/Session/SessionHandler.php
@@ -76,7 +76,7 @@ public function write($sid, $value) {
         'uid' => $request->getSession()->get('uid', 0),
         'hostname' => $request->getClientIP(),
         'session' => $value,
-        'timestamp' => REQUEST_TIME,
+        'timestamp' => \Drupal::time()->getRequestTime(),
       ];
       $this->connection->merge('sessions')
         ->keys(['sid' => Crypt::hashBase64($sid)])
@@ -125,7 +125,7 @@ public function gc($lifetime) {
     // to '1814400'. At that value, only after a user doesn't log in after
     // three weeks (1814400 seconds) will their session be removed.
     $this->connection->delete('sessions')
-      ->condition('timestamp', REQUEST_TIME - $lifetime, '<')
+      ->condition('timestamp', \Drupal::time()->getRequestTime() - $lifetime, '<')
       ->execute();
     return TRUE;
   }
diff --git a/core/lib/Drupal/Core/Session/SessionManager.php b/core/lib/Drupal/Core/Session/SessionManager.php
index 27e05809ad..c63b59dc62 100644
--- a/core/lib/Drupal/Core/Session/SessionManager.php
+++ b/core/lib/Drupal/Core/Session/SessionManager.php
@@ -232,7 +232,7 @@ public function regenerate($destroy = FALSE, $lifetime = NULL) {
 
     if (isset($old_session_id)) {
       $params = session_get_cookie_params();
-      $expire = $params['lifetime'] ? REQUEST_TIME + $params['lifetime'] : 0;
+      $expire = $params['lifetime'] ? \Drupal::time()->getRequestTime() + $params['lifetime'] : 0;
       setcookie($this->getName(), $this->getId(), $expire, $params['path'], $params['domain'], $params['secure'], $params['httponly']);
       $this->migrateStoredSession($old_session_id);
     }
@@ -265,7 +265,7 @@ public function destroy() {
     // setcookie() can only be called when headers are not yet sent.
     if ($cookies->has($session_name) && !headers_sent()) {
       $params = session_get_cookie_params();
-      setcookie($session_name, '', REQUEST_TIME - 3600, $params['path'], $params['domain'], $params['secure'], $params['httponly']);
+      setcookie($session_name, '', \Drupal::time()->getRequestTime() - 3600, $params['path'], $params['domain'], $params['secure'], $params['httponly']);
       $cookies->remove($session_name);
     }
   }
diff --git a/core/lib/Drupal/Core/Template/TwigPhpStorageCache.php b/core/lib/Drupal/Core/Template/TwigPhpStorageCache.php
index 995ce97803..d50075e234 100644
--- a/core/lib/Drupal/Core/Template/TwigPhpStorageCache.php
+++ b/core/lib/Drupal/Core/Template/TwigPhpStorageCache.php
@@ -111,7 +111,7 @@ public function write($key, $content) {
     $this->storage()->save($key, $content);
     // Save the last mtime.
     $cid = 'twig:' . $key;
-    $this->cache->set($cid, REQUEST_TIME);
+    $this->cache->set($cid, \Drupal::time()->getRequestTime());
   }
 
   /**
diff --git a/core/modules/aggregator/src/Controller/AggregatorController.php b/core/modules/aggregator/src/Controller/AggregatorController.php
index 5beb15441c..e85f19d65b 100644
--- a/core/modules/aggregator/src/Controller/AggregatorController.php
+++ b/core/modules/aggregator/src/Controller/AggregatorController.php
@@ -120,12 +120,12 @@ public function adminOverview() {
       $last_checked = $feed->getLastCheckedTime();
       $refresh_rate = $feed->getRefreshRate();
 
-      $row[] = ($last_checked ? $this->t('@time ago', ['@time' => $this->dateFormatter->formatInterval(REQUEST_TIME - $last_checked)]) : $this->t('never'));
+      $row[] = ($last_checked ? $this->t('@time ago', ['@time' => $this->dateFormatter->formatInterval(\Drupal::time()->getRequestTime() - $last_checked)]) : $this->t('never'));
       if (!$last_checked && $refresh_rate) {
         $next_update = $this->t('imminently');
       }
       elseif ($last_checked && $refresh_rate) {
-        $next_update = $next = $this->t('%time left', ['%time' => $this->dateFormatter->formatInterval($last_checked + $refresh_rate - REQUEST_TIME)]);
+        $next_update = $next = $this->t('%time left', ['%time' => $this->dateFormatter->formatInterval($last_checked + $refresh_rate - \Drupal::time()->getRequestTime())]);
       }
       else {
         $next_update = $this->t('never');
diff --git a/core/modules/aggregator/src/Entity/Feed.php b/core/modules/aggregator/src/Entity/Feed.php
index 4c3a5b856e..3e8dd3bea8 100644
--- a/core/modules/aggregator/src/Entity/Feed.php
+++ b/core/modules/aggregator/src/Entity/Feed.php
@@ -85,7 +85,7 @@ public function refreshItems() {
     $success = \Drupal::service('aggregator.items.importer')->refresh($this);
 
     // Regardless of successful or not, indicate that it has been checked.
-    $this->setLastCheckedTime(REQUEST_TIME);
+    $this->setLastCheckedTime(\Drupal::time()->getRequestTime());
     $this->setQueuedTime(0);
     $this->save();
 
diff --git a/core/modules/aggregator/src/FeedStorage.php b/core/modules/aggregator/src/FeedStorage.php
index fc5eddeae7..5dc7cbdcdf 100644
--- a/core/modules/aggregator/src/FeedStorage.php
+++ b/core/modules/aggregator/src/FeedStorage.php
@@ -17,7 +17,7 @@ class FeedStorage extends SqlContentEntityStorage implements FeedStorageInterfac
    */
   public function getFeedIdsToRefresh() {
     return $this->database->query('SELECT fid FROM {' . $this->getBaseTable() . '} WHERE queued = 0 AND checked + refresh < :time AND refresh <> :never', [
-      ':time' => REQUEST_TIME,
+      ':time' => \Drupal::time()->getRequestTime(),
       ':never' => static::CLEAR_NEVER,
     ])->fetchCol();
   }
diff --git a/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php b/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php
index 5f0eade44e..caa360d2ac 100644
--- a/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php
+++ b/core/modules/aggregator/src/Plugin/aggregator/processor/DefaultProcessor.php
@@ -257,7 +257,7 @@ public function postProcess(FeedInterface $feed) {
 
     if ($aggregator_clear != FeedStorageInterface::CLEAR_NEVER) {
       // Delete all items that are older than flush item timer.
-      $age = REQUEST_TIME - $aggregator_clear;
+      $age = \Drupal::time()->getRequestTime() - $aggregator_clear;
       $result = $this->itemStorage->getQuery()
         ->condition('fid', $feed->id())
         ->condition('timestamp', $age, '<')
diff --git a/core/modules/comment/src/CommentForm.php b/core/modules/comment/src/CommentForm.php
index 48c72712df..b8197c8648 100644
--- a/core/modules/comment/src/CommentForm.php
+++ b/core/modules/comment/src/CommentForm.php
@@ -284,7 +284,7 @@ public function buildEntity(array $form, FormStateInterface $form_state) {
       $comment->setCreatedTime($form_state->getValue('date')->getTimestamp());
     }
     else {
-      $comment->setCreatedTime(REQUEST_TIME);
+      $comment->setCreatedTime(\Drupal::time()->getRequestTime());
     }
     // Empty author ID should revert to anonymous.
     $author_id = $form_state->getValue('uid');
diff --git a/core/modules/comment/src/CommentStatistics.php b/core/modules/comment/src/CommentStatistics.php
index 1bcb22a38b..32867fe210 100644
--- a/core/modules/comment/src/CommentStatistics.php
+++ b/core/modules/comment/src/CommentStatistics.php
@@ -136,8 +136,9 @@ public function create(FieldableEntityInterface $entity, $fields) {
         // EntityOwnerInterface or author is not set.
         $last_comment_uid = $this->currentUser->id();
       }
-      // Default to REQUEST_TIME when entity does not have a changed property.
-      $last_comment_timestamp = REQUEST_TIME;
+      // Default to \Drupal::time()->getRequestTime() when entity does not have
+      // a changed property.
+      $last_comment_timestamp = \Drupal::time()->getRequestTime();
       // @todo Make comment statistics language aware and add some tests. See
       //   https://www.drupal.org/node/2318875
       if ($entity instanceof EntityChangedInterface) {
@@ -258,8 +259,8 @@ public function update(CommentInterface $comment) {
           'cid' => 0,
           'comment_count' => 0,
           // Use the changed date of the entity if it's set, or default to
-          // REQUEST_TIME.
-          'last_comment_timestamp' => ($entity instanceof EntityChangedInterface) ? $entity->getChangedTimeAcrossTranslations() : REQUEST_TIME,
+          // \Drupal::time()->getRequestTime().
+          'last_comment_timestamp' => ($entity instanceof EntityChangedInterface) ? $entity->getChangedTimeAcrossTranslations() : \Drupal::time()->getRequestTime(),
           'last_comment_name' => '',
           'last_comment_uid' => $last_comment_uid,
         ])
diff --git a/core/modules/config_translation/src/FormElement/DateFormat.php b/core/modules/config_translation/src/FormElement/DateFormat.php
index d0ae033a42..8cd218e0ec 100644
--- a/core/modules/config_translation/src/FormElement/DateFormat.php
+++ b/core/modules/config_translation/src/FormElement/DateFormat.php
@@ -16,7 +16,7 @@ public function getTranslationElement(LanguageInterface $translation_language, $
     /** @var \Drupal\Core\Datetime\DateFormatterInterface $date_formatter */
     $date_formatter = \Drupal::service('date.formatter');
     $description = $this->t('A user-defined date format. See the <a href="http://php.net/manual/function.date.php">PHP manual</a> for available options.');
-    $format = $this->t('Displayed as %date_format', ['%date_format' => $date_formatter->format(REQUEST_TIME, 'custom', $translation_config)]);
+    $format = $this->t('Displayed as %date_format', ['%date_format' => $date_formatter->format(\Drupal::time()->getRequestTime(), 'custom', $translation_config)]);
 
     return [
       '#type' => 'textfield',
diff --git a/core/modules/content_translation/src/ContentTranslationHandler.php b/core/modules/content_translation/src/ContentTranslationHandler.php
index 44dea176d5..8373515663 100644
--- a/core/modules/content_translation/src/ContentTranslationHandler.php
+++ b/core/modules/content_translation/src/ContentTranslationHandler.php
@@ -521,14 +521,14 @@ public function entityFormAlter(array &$form, FormStateInterface $form_state, En
         '#description' => t('Leave blank for %anonymous.', ['%anonymous' => \Drupal::config('user.settings')->get('anonymous')]),
       ];
 
-      $date = $new_translation ? REQUEST_TIME : $metadata->getCreatedTime();
+      $date = $new_translation ? \Drupal::time()->getRequestTime() : $metadata->getCreatedTime();
       $form['content_translation']['created'] = [
         '#type' => 'textfield',
         '#title' => t('Authored on'),
         '#maxlength' => 25,
         '#description' => t('Format: %time. The date format is YYYY-MM-DD and %timezone is the time zone offset from UTC. Leave blank to use the time of form submission.', [
-          '%time' => $this->dateFormatter->format(REQUEST_TIME, 'custom', 'Y-m-d H:i:s O'),
-          '%timezone' => $this->dateFormatter->format(REQUEST_TIME, 'custom', 'O'),
+          '%time' => $this->dateFormatter->format(\Drupal::time()->getRequestTime(), 'custom', 'Y-m-d H:i:s O'),
+          '%timezone' => $this->dateFormatter->format(\Drupal::time()->getRequestTime(), 'custom', 'O'),
         ]),
         '#default_value' => $new_translation || !$date ? '' : $this->dateFormatter->format($date, 'custom', 'Y-m-d H:i:s O'),
       ];
@@ -678,7 +678,7 @@ public function entityFormEntityBuild($entity_type, EntityInterface $entity, arr
     $metadata = $this->manager->getTranslationMetadata($entity);
     $metadata->setAuthor(!empty($values['uid']) ? User::load($values['uid']) : User::load(0));
     $metadata->setPublished(!empty($values['status']));
-    $metadata->setCreatedTime(!empty($values['created']) ? strtotime($values['created']) : REQUEST_TIME);
+    $metadata->setCreatedTime(!empty($values['created']) ? strtotime($values['created']) : \Drupal::time()->getRequestTime());
 
     $metadata->setOutdated(!empty($values['outdated']));
     if (!empty($values['retranslate'])) {
@@ -725,7 +725,7 @@ public function entityFormSubmit($form, FormStateInterface $form_state) {
     // handler as well and have the same logic like in the Form API.
     if ($entity->hasField('content_translation_changed')) {
       $metadata = $this->manager->getTranslationMetadata($entity);
-      $metadata->setChangedTime(REQUEST_TIME);
+      $metadata->setChangedTime(\Drupal::time()->getRequestTime());
     }
   }
 
diff --git a/core/modules/content_translation/src/Controller/ContentTranslationController.php b/core/modules/content_translation/src/Controller/ContentTranslationController.php
index 5d48cc0533..c9eb61b4fa 100644
--- a/core/modules/content_translation/src/Controller/ContentTranslationController.php
+++ b/core/modules/content_translation/src/Controller/ContentTranslationController.php
@@ -88,7 +88,7 @@ public function prepareTranslation(ContentEntityInterface $entity, LanguageInter
     // Update the translation author to current user, as well the translation
     // creation time.
     $metadata->setAuthor($user);
-    $metadata->setCreatedTime(REQUEST_TIME);
+    $metadata->setCreatedTime(\Drupal::time()->getRequestTime());
     $metadata->setSource($source_langcode);
   }
 
diff --git a/core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php b/core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php
index 3264069008..2c3ac8e90d 100644
--- a/core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php
+++ b/core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php
@@ -107,7 +107,7 @@ public static function generateSampleValue(FieldDefinitionInterface $field_defin
 
     // Just pick a date in the past year. No guidance is provided by this Field
     // type.
-    $timestamp = REQUEST_TIME - mt_rand(0, 86400 * 365);
+    $timestamp = \Drupal::time()->getRequestTime() - mt_rand(0, 86400 * 365);
     if ($type == DateTimeItem::DATETIME_TYPE_DATE) {
       $values['value'] = gmdate(static::DATE_STORAGE_FORMAT, $timestamp);
     }
diff --git a/core/modules/datetime_range/src/Plugin/Field/FieldType/DateRangeItem.php b/core/modules/datetime_range/src/Plugin/Field/FieldType/DateRangeItem.php
index 7c34ed127c..3a7d742525 100644
--- a/core/modules/datetime_range/src/Plugin/Field/FieldType/DateRangeItem.php
+++ b/core/modules/datetime_range/src/Plugin/Field/FieldType/DateRangeItem.php
@@ -94,7 +94,7 @@ public static function generateSampleValue(FieldDefinitionInterface $field_defin
 
     // Just pick a date in the past year. No guidance is provided by this Field
     // type.
-    $start = REQUEST_TIME - mt_rand(0, 86400 * 365) - 86400;
+    $start = \Drupal::time()->getRequestTime() - mt_rand(0, 86400 * 365) - 86400;
     $end = $start + 86400;
     if ($type == static::DATETIME_TYPE_DATETIME) {
       $values['value'] = gmdate(DateTimeItemInterface::DATETIME_STORAGE_FORMAT, $start);
diff --git a/core/modules/history/src/Plugin/views/filter/HistoryUserTimestamp.php b/core/modules/history/src/Plugin/views/filter/HistoryUserTimestamp.php
index 02288da1c4..a01b1b21d8 100644
--- a/core/modules/history/src/Plugin/views/filter/HistoryUserTimestamp.php
+++ b/core/modules/history/src/Plugin/views/filter/HistoryUserTimestamp.php
@@ -81,7 +81,7 @@ public function query() {
 
     // Hey, Drupal kills old history, so nodes that haven't been updated
     // since HISTORY_READ_LIMIT are bzzzzzzzt outta here!
-    $limit = REQUEST_TIME - HISTORY_READ_LIMIT;
+    $limit = \Drupal::time()->getRequestTime() - HISTORY_READ_LIMIT;
 
     $this->ensureMyTable();
     $field = "$this->tableAlias.$this->realField";
diff --git a/core/modules/locale/src/Form/TranslationStatusForm.php b/core/modules/locale/src/Form/TranslationStatusForm.php
index a6d914afe9..2986ea9c91 100644
--- a/core/modules/locale/src/Form/TranslationStatusForm.php
+++ b/core/modules/locale/src/Form/TranslationStatusForm.php
@@ -280,7 +280,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
     // translation updates. If the status is expired we clear it an run a batch to
     // update the status and then fetch the translation updates.
     $last_checked = $this->state->get('locale.translation_last_checked');
-    if ($last_checked < REQUEST_TIME - LOCALE_TRANSLATION_STATUS_TTL) {
+    if ($last_checked < \Drupal::time()->getRequestTime() - LOCALE_TRANSLATION_STATUS_TTL) {
       locale_translation_clear_status();
       $batch = locale_translation_batch_update_build([], $langcodes, $options);
       batch_set($batch);
diff --git a/core/modules/migrate_drupal_ui/src/Batch/MigrateUpgradeImportBatch.php b/core/modules/migrate_drupal_ui/src/Batch/MigrateUpgradeImportBatch.php
index c9c19a5c30..d66c4cb71e 100644
--- a/core/modules/migrate_drupal_ui/src/Batch/MigrateUpgradeImportBatch.php
+++ b/core/modules/migrate_drupal_ui/src/Batch/MigrateUpgradeImportBatch.php
@@ -286,7 +286,7 @@ public static function finished($success, $results, $operations, $elapsed) {
    */
   public static function onPostRowSave(MigratePostRowSaveEvent $event) {
     // We want to interrupt this batch and start a fresh one.
-    if ((time() - REQUEST_TIME) > static::$maxExecTime) {
+    if ((time() - \Drupal::time()->getRequestTime()) > static::$maxExecTime) {
       $event->getMigration()->interruptMigration(MigrationInterface::RESULT_INCOMPLETE);
     }
   }
@@ -317,7 +317,7 @@ public static function onPostImport(MigrateImportEvent $event) {
    */
   public static function onPostRowDelete(MigrateRowDeleteEvent $event) {
     // We want to interrupt this batch and start a fresh one.
-    if ((time() - REQUEST_TIME) > static::$maxExecTime) {
+    if ((time() - \Drupal::time()->getRequestTime()) > static::$maxExecTime) {
       $event->getMigration()->interruptMigration(MigrationInterface::RESULT_INCOMPLETE);
     }
   }
diff --git a/core/modules/migrate_drupal_ui/src/Form/ReviewForm.php b/core/modules/migrate_drupal_ui/src/Form/ReviewForm.php
index 5be85c42f2..74072e721a 100644
--- a/core/modules/migrate_drupal_ui/src/Form/ReviewForm.php
+++ b/core/modules/migrate_drupal_ui/src/Form/ReviewForm.php
@@ -244,7 +244,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
     batch_set($batch);
     $form_state->setRedirect('<front>');
     $this->store->set('step', 'overview');
-    $this->state->set('migrate_drupal_ui.performed', REQUEST_TIME);
+    $this->state->set('migrate_drupal_ui.performed', \Drupal::time()->getRequestTime());
   }
 
   /**
diff --git a/core/modules/search/search.services.yml b/core/modules/search/search.services.yml
index 49ec2acb7b..4ba5ba929b 100644
--- a/core/modules/search/search.services.yml
+++ b/core/modules/search/search.services.yml
@@ -9,4 +9,4 @@ services:
 
   search.index:
     class: Drupal\search\SearchIndex
-    arguments: ['@config.factory', '@database','@database.replica', '@cache_tags.invalidator']
+    arguments: ['@config.factory', '@database','@database.replica', '@cache_tags.invalidator', '@datetime.time']
diff --git a/core/modules/search/src/SearchIndex.php b/core/modules/search/src/SearchIndex.php
index e5655d4974..f0d56a9c69 100644
--- a/core/modules/search/src/SearchIndex.php
+++ b/core/modules/search/src/SearchIndex.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\search;
 
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
 use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Database\Connection;
@@ -41,6 +42,13 @@ class SearchIndex implements SearchIndexInterface {
    */
   protected $cacheTagsInvalidator;
 
+  /**
+   * The time service.
+   *
+   * @var \Drupal\Component\Datetime\TimeInterface
+   */
+  protected $time;
+
   /**
    * SearchIndex constructor.
    *
@@ -52,12 +60,15 @@ class SearchIndex implements SearchIndexInterface {
    *   The database replica connection.
    * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
    *   The cache tags invalidator.
+   * @param \Drupal\Component\Datetime\TimeInterface $time
+   *   The time service.
    */
-  public function __construct(ConfigFactoryInterface $config_factory, Connection $connection, Connection $replica, CacheTagsInvalidatorInterface $cache_tags_invalidator) {
+  public function __construct(ConfigFactoryInterface $config_factory, Connection $connection, Connection $replica, CacheTagsInvalidatorInterface $cache_tags_invalidator, TimeInterface $time) {
     $this->configFactory = $config_factory;
     $this->connection = $connection;
     $this->replica = $replica;
     $this->cacheTagsInvalidator = $cache_tags_invalidator;
+    $this->time = $time;
   }
 
   /**
@@ -256,7 +267,7 @@ public function markForReindex($type = NULL, $sid = NULL, $langcode = NULL) {
 
     try {
       $query = $this->connection->update('search_dataset')
-        ->fields(['reindex' => REQUEST_TIME])
+        ->fields(['reindex' => $this->time->getRequestTime()])
         // Only mark items that were not previously marked for reindex, so that
         // marked items maintain their priority by request time.
         ->condition('reindex', 0);
diff --git a/core/modules/system/src/DateFormatListBuilder.php b/core/modules/system/src/DateFormatListBuilder.php
index 0c94a64197..cf65b21c13 100644
--- a/core/modules/system/src/DateFormatListBuilder.php
+++ b/core/modules/system/src/DateFormatListBuilder.php
@@ -64,7 +64,7 @@ public function buildHeader() {
    */
   public function buildRow(EntityInterface $entity) {
     $row['label'] = $entity->label();
-    $row['pattern'] = $this->dateFormatter->format(REQUEST_TIME, $entity->id());
+    $row['pattern'] = $this->dateFormatter->format(\Drupal::time()->getRequestTime(), $entity->id());
     return $row + parent::buildRow($entity);
   }
 
diff --git a/core/modules/system/src/Form/DateFormatDeleteForm.php b/core/modules/system/src/Form/DateFormatDeleteForm.php
index 1558032825..39fd6dbb86 100644
--- a/core/modules/system/src/Form/DateFormatDeleteForm.php
+++ b/core/modules/system/src/Form/DateFormatDeleteForm.php
@@ -45,7 +45,7 @@ public static function create(ContainerInterface $container) {
   public function getQuestion() {
     return t('Are you sure you want to delete the format %name : %format?', [
       '%name' => $this->entity->label(),
-      '%format' => $this->dateFormatter->format(REQUEST_TIME, $this->entity->id()),
+      '%format' => $this->dateFormatter->format(\Drupal::time()->getRequestTime(), $this->entity->id()),
     ]);
   }
 
diff --git a/core/modules/system/src/Form/DateFormatEditForm.php b/core/modules/system/src/Form/DateFormatEditForm.php
index d6ad88e8ea..083b117492 100644
--- a/core/modules/system/src/Form/DateFormatEditForm.php
+++ b/core/modules/system/src/Form/DateFormatEditForm.php
@@ -17,7 +17,7 @@ class DateFormatEditForm extends DateFormatFormBase {
   public function form(array $form, FormStateInterface $form_state) {
     $form = parent::form($form, $form_state);
 
-    $now = t('Displayed as %date', ['%date' => $this->dateFormatter->format(REQUEST_TIME, $this->entity->id())]);
+    $now = t('Displayed as %date', ['%date' => $this->dateFormatter->format(\Drupal::time()->getRequestTime(), $this->entity->id())]);
     $form['date_format_pattern']['#field_suffix'] = ' <small data-drupal-date-formatter="preview">' . $now . '</small>';
     $form['date_format_pattern']['#default_value'] = $this->entity->getPattern();
 
diff --git a/core/modules/toolbar/src/Controller/ToolbarController.php b/core/modules/toolbar/src/Controller/ToolbarController.php
index c94e35b307..494d0f34bf 100644
--- a/core/modules/toolbar/src/Controller/ToolbarController.php
+++ b/core/modules/toolbar/src/Controller/ToolbarController.php
@@ -34,7 +34,7 @@ public function subtreesAjax() {
     $response->setMaxAge($max_age);
 
     $expires = new \DateTime();
-    $expires->setTimestamp(REQUEST_TIME + $max_age);
+    $expires->setTimestamp(\Drupal::time()->getRequestTime() + $max_age);
     $response->setExpires($expires);
 
     return $response;
diff --git a/core/modules/update/src/UpdateProcessor.php b/core/modules/update/src/UpdateProcessor.php
index 25dfc7a004..fd62e4c275 100644
--- a/core/modules/update/src/UpdateProcessor.php
+++ b/core/modules/update/src/UpdateProcessor.php
@@ -118,7 +118,7 @@ public function createFetchTask($project) {
     if (empty($this->fetchTasks[$project['name']])) {
       $this->fetchQueue->createItem($project);
       $this->fetchTaskStore->set($project['name'], $project);
-      $this->fetchTasks[$project['name']] = REQUEST_TIME;
+      $this->fetchTasks[$project['name']] = \Drupal::time()->getRequestTime();
     }
   }
 
@@ -139,9 +139,9 @@ public function fetchData() {
   public function processFetchTask($project) {
     global $base_url;
 
-    // This can be in the middle of a long-running batch, so REQUEST_TIME won't
-    // necessarily be valid.
-    $request_time_difference = time() - REQUEST_TIME;
+    // This can be in the middle of a long-running batch,
+    // so \Drupal::time()->getRequestTime() won't necessarily be valid.
+    $request_time_difference = \Drupal::time()->getCurrentTime() - \Drupal::time()->getRequestTime();
     if (empty($this->failed)) {
       // If we have valid data about release history XML servers that we have
       // failed to fetch from on previous attempts, load that.
@@ -179,14 +179,14 @@ public function processFetchTask($project) {
     }
 
     $frequency = $this->updateSettings->get('check.interval_days');
-    $available['last_fetch'] = REQUEST_TIME + $request_time_difference;
+    $available['last_fetch'] = \Drupal::time()->getRequestTime() + $request_time_difference;
     $this->availableReleasesTempStore->setWithExpire($project_name, $available, $request_time_difference + (60 * 60 * 24 * $frequency));
 
     // Stash the $this->failed data back in the DB for the next 5 minutes.
     $this->tempStore->setWithExpire('fetch_failures', $this->failed, $request_time_difference + (60 * 5));
 
     // Whether this worked or not, we did just (try to) check for updates.
-    $this->stateStore->set('update.last_check', REQUEST_TIME + $request_time_difference);
+    $this->stateStore->set('update.last_check', \Drupal::time()->getRequestTime() + $request_time_difference);
 
     // Now that we processed the fetch task for this project, clear out the
     // record for this task so we're willing to fetch again.
diff --git a/core/modules/user/src/Controller/UserController.php b/core/modules/user/src/Controller/UserController.php
index 7516da93c6..da7cc672c5 100644
--- a/core/modules/user/src/Controller/UserController.php
+++ b/core/modules/user/src/Controller/UserController.php
@@ -225,7 +225,7 @@ public function getResetPassForm(Request $request, $uid) {
    */
   public function resetPassLogin($uid, $timestamp, $hash) {
     // The current user is not logged in, so check the parameters.
-    $current = REQUEST_TIME;
+    $current = \Drupal::time()->getRequestTime();
     /** @var \Drupal\user\UserInterface $user */
     $user = $this->userStorage->load($uid);
 
@@ -337,7 +337,7 @@ public function logout() {
   public function confirmCancel(UserInterface $user, $timestamp = 0, $hashed_pass = '') {
     // Time out in seconds until cancel URL expires; 24 hours = 86400 seconds.
     $timeout = 86400;
-    $current = REQUEST_TIME;
+    $current = \Drupal::time()->getRequestTime();
 
     // Basic validation of arguments.
     $account_data = $this->userData->get('user', $user->id());
diff --git a/core/modules/user/src/EventSubscriber/UserRequestSubscriber.php b/core/modules/user/src/EventSubscriber/UserRequestSubscriber.php
index bf0e621ac1..bf5cc57640 100644
--- a/core/modules/user/src/EventSubscriber/UserRequestSubscriber.php
+++ b/core/modules/user/src/EventSubscriber/UserRequestSubscriber.php
@@ -55,11 +55,11 @@ public function __construct(AccountInterface $account, EntityTypeManagerInterfac
    *   The event to process.
    */
   public function onKernelTerminate(PostResponseEvent $event) {
-    if ($this->account->isAuthenticated() && REQUEST_TIME - $this->account->getLastAccessedTime() > Settings::get('session_write_interval', 180)) {
+    if ($this->account->isAuthenticated() && \Drupal::time()->getRequestTime() - $this->account->getLastAccessedTime() > Settings::get('session_write_interval', 180)) {
       // Do that no more than once per 180 seconds.
       /** @var \Drupal\user\UserStorageInterface $storage */
       $storage = $this->entityTypeManager->getStorage('user');
-      $storage->updateLastAccessTimestamp($this->account, REQUEST_TIME);
+      $storage->updateLastAccessTimestamp($this->account, \Drupal::time()->getRequestTime());
     }
   }
 
diff --git a/core/modules/views/src/Plugin/views/argument/Date.php b/core/modules/views/src/Plugin/views/argument/Date.php
index 852e21f04b..8d994e26a7 100644
--- a/core/modules/views/src/Plugin/views/argument/Date.php
+++ b/core/modules/views/src/Plugin/views/argument/Date.php
@@ -107,7 +107,7 @@ public function defaultArgumentForm(&$form, FormStateInterface $form_state) {
    */
   public function getDefaultArgument($raw = FALSE) {
     if (!$raw && $this->options['default_argument_type'] == 'date') {
-      return date($this->argFormat, REQUEST_TIME);
+      return date($this->argFormat, \Drupal::time()->getRequestTime());
     }
     elseif (!$raw && in_array($this->options['default_argument_type'], ['node_created', 'node_changed'])) {
       $node = $this->routeMatch->getParameter('node');
diff --git a/core/modules/views/src/Plugin/views/cache/Time.php b/core/modules/views/src/Plugin/views/cache/Time.php
index 962693d921..2f31a59096 100644
--- a/core/modules/views/src/Plugin/views/cache/Time.php
+++ b/core/modules/views/src/Plugin/views/cache/Time.php
@@ -156,7 +156,7 @@ protected function getLifespan($type) {
   protected function cacheExpire($type) {
     $lifespan = $this->getLifespan($type);
     if ($lifespan) {
-      $cutoff = REQUEST_TIME - $lifespan;
+      $cutoff = \Drupal::time()->getRequestTime() - $lifespan;
       return $cutoff;
     }
     else {
diff --git a/core/modules/views/src/Plugin/views/field/Date.php b/core/modules/views/src/Plugin/views/field/Date.php
index 639bc2329a..0d2b45eae2 100644
--- a/core/modules/views/src/Plugin/views/field/Date.php
+++ b/core/modules/views/src/Plugin/views/field/Date.php
@@ -85,7 +85,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
 
     $date_formats = [];
     foreach ($this->dateFormatStorage->loadMultiple() as $machine_name => $value) {
-      $date_formats[$machine_name] = $this->t('@name format: @date', ['@name' => $value->label(), '@date' => $this->dateFormatter->format(REQUEST_TIME, $machine_name)]);
+      $date_formats[$machine_name] = $this->t('@name format: @date', ['@name' => $value->label(), '@date' => $this->dateFormatter->format(\Drupal::time()->getRequestTime(), $machine_name)]);
     }
 
     $form['date_format'] = [
@@ -145,7 +145,7 @@ public function render(ResultRow $values) {
       $timezone = !empty($this->options['timezone']) ? $this->options['timezone'] : NULL;
       // Will be positive for a datetime in the past (ago), and negative for a
       // datetime in the future (hence).
-      $time_diff = REQUEST_TIME - $value;
+      $time_diff = \Drupal::time()->getRequestTime() - $value;
       switch ($format) {
         case 'raw time ago':
           return $this->dateFormatter->formatTimeDiffSince($value, ['granularity' => is_numeric($custom_format) ? $custom_format : 2]);
diff --git a/core/modules/views/src/ViewExecutable.php b/core/modules/views/src/ViewExecutable.php
index 9ee37041c0..716067623e 100644
--- a/core/modules/views/src/ViewExecutable.php
+++ b/core/modules/views/src/ViewExecutable.php
@@ -1686,7 +1686,7 @@ public function preExecute($args = []) {
     \Drupal::moduleHandler()->invokeAll('views_pre_view', [$this, $display_id, &$this->args]);
 
     // Allow hook_views_pre_view() to set the dom_id, then ensure it is set.
-    $this->dom_id = !empty($this->dom_id) ? $this->dom_id : hash('sha256', $this->storage->id() . REQUEST_TIME . mt_rand());
+    $this->dom_id = !empty($this->dom_id) ? $this->dom_id : hash('sha256', $this->storage->id() . \Drupal::time()->getRequestTime() . mt_rand());
 
     // Allow the display handler to set up for execution
     $this->display_handler->preExecute();
