diff --git a/core/core.services.yml b/core/core.services.yml
index 66ab7333cce..233bf4379e5 100644
--- a/core/core.services.yml
+++ b/core/core.services.yml
@@ -225,17 +225,21 @@ services:
     calls:
       - [setContainer, ['@service_container']]
   cache.backend.database:
+    autowire: true
     class: Drupal\Core\Cache\DatabaseBackendFactory
     arguments: ['@database', '@cache_tags.invalidator.checksum', '@settings']
     tags:
       - { name: backend_overridable }
   cache.backend.apcu:
+    autowire: true
     class: Drupal\Core\Cache\ApcuBackendFactory
     arguments: ['%app.root%', '%site.path%', '@cache_tags.invalidator.checksum']
   cache.backend.php:
+    autowire: true
     class: Drupal\Core\Cache\PhpBackendFactory
     arguments: ['@cache_tags.invalidator.checksum']
   cache.backend.memory:
+    autowire: true
     class: Drupal\Core\Cache\MemoryBackendFactory
   # A special cache bin that does not persist beyond the length of the request.
   cache.static:
@@ -457,6 +461,7 @@ services:
     class: Drupal\Core\KeyValueStore\KeyValueExpirableFactory
     arguments: ['@service_container', '%factory.keyvalue.expirable%']
   keyvalue.expirable.database:
+    autowire: true
     class: Drupal\Core\KeyValueStore\KeyValueDatabaseExpirableFactory
     arguments: ['@serialization.phpserialize', '@database']
   logger.factory:
@@ -649,6 +654,7 @@ services:
     arguments: ['@theme_handler', '@config.factory', '@config.installer', '@module_handler', '@config.manager', '@asset.css.collection_optimizer', '@router.builder', '@logger.channel.default', '@state', '@extension.list.module', '@theme.registry']
   Drupal\Core\Extension\ThemeInstallerInterface: '@theme_installer'
   entity.memory_cache:
+    autowire: true
     class: Drupal\Core\Cache\MemoryCache\MemoryCache
   Drupal\Core\Cache\MemoryCache\MemoryCacheInterface: '@entity.memory_cache'
   entity_type.manager:
@@ -1324,6 +1330,7 @@ services:
     class: Drupal\Core\EventSubscriber\HtmlResponseSubscriber
     arguments: ['@html_response.attachments_processor']
   finish_response_subscriber:
+    autowire: true
     class: Drupal\Core\EventSubscriber\FinishResponseSubscriber
     arguments: ['@language_manager', '@config.factory', '@page_cache_request_policy', '@page_cache_response_policy', '@cache_contexts_manager', '%http.response.debug_cacheability_headers%']
   response_generator_subscriber:
@@ -1404,6 +1411,7 @@ services:
     class: Drupal\Core\Transliteration\PhpTransliteration
     arguments: [null, '@module_handler']
   flood:
+    autowire: true
     class: Drupal\Core\Flood\DatabaseBackend
     arguments: ['@database', '@request_stack']
     tags:
@@ -1557,6 +1565,7 @@ services:
   session_handler:
     alias: session_handler.storage
   session_handler.storage:
+    autowire: true
     class: Drupal\Core\Session\SessionHandler
     arguments: ['@request_stack', '@database']
     tags:
@@ -1567,6 +1576,7 @@ services:
       - { name: session_handler_proxy, priority: 150 }
   Drupal\Core\Session\WriteSafeSessionHandlerInterface: '@session_handler.write_safe'
   session_manager:
+    autowire: true
     class: Drupal\Core\Session\SessionManager
     arguments: ['@request_stack', '@database', '@session_manager.metadata_bag', '@session_configuration', '@session_handler']
     tags:
@@ -1593,6 +1603,7 @@ services:
     class: Drupal\Core\Asset\AssetDumper
     arguments: ['@file_system']
   asset.js.collection_renderer:
+    autowire: true
     class: Drupal\Core\Asset\JsCollectionRenderer
     arguments: [ '@state', '@file_url_generator' ]
   asset.js.collection_optimizer:
diff --git a/core/drupalci.yml b/core/drupalci.yml
index cd92d8102d7..5c89c64072a 100644
--- a/core/drupalci.yml
+++ b/core/drupalci.yml
@@ -3,17 +3,18 @@
 # https://www.drupal.org/drupalorg/docs/drupal-ci/customizing-drupalci-testing
 _phpunit_testgroups_to_execute: &testgroups
   # Default: all of Drupal core's test suite runs.
-  testgroups: '--all'
+  #testgroups: '--all'
+  testgroups: 'update'
   # Alternative: run only the tests for one particular module.
   # testgroups: '--module ckeditor5'
 build:
   assessment:
     testing:
       # Run code quality checks.
-      container_command.commit-checks:
-        commands:
-          - "core/scripts/dev/commit-code-check.sh --drupalci"
-        halt-on-fail: true
+#      container_command.commit-checks:
+#        commands:
+#          - "core/scripts/dev/commit-code-check.sh --drupalci"
+#        halt-on-fail: true
       # run_tests task is executed several times in order of performance speeds.
       # halt-on-fail can be set on the run_tests tasks in order to fail fast.
       # suppress-deprecations is false in order to be alerted to usages of
@@ -48,4 +49,4 @@ build:
         <<: *testgroups
       # Run nightwatch testing.
       # @see https://www.drupal.org/project/drupal/issues/2869825
-      nightwatchjs: {}
+#      nightwatchjs: {}
diff --git a/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php b/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php
index 7c71e4f6dd9..44347177bd4 100644
--- a/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php
+++ b/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Core\Asset;
 
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Component\Serialization\Json;
 use Drupal\Core\File\FileUrlGeneratorInterface;
 use Drupal\Core\State\StateInterface;
@@ -25,6 +26,11 @@ class JsCollectionRenderer implements AssetCollectionRendererInterface {
    */
   protected $fileUrlGenerator;
 
+  /**
+   * The time service.
+   */
+  protected readonly TimeInterface $time;
+
   /**
    * Constructs a JsCollectionRenderer.
    *
@@ -32,10 +38,21 @@ class JsCollectionRenderer implements AssetCollectionRendererInterface {
    *   The state key/value store.
    * @param \Drupal\Core\File\FileUrlGeneratorInterface $file_url_generator
    *   The file URL generator.
+   * @param \Drupal\Component\Datetime\TimeInterface|null $time
+   *   The time service.
    */
-  public function __construct(StateInterface $state, FileUrlGeneratorInterface $file_url_generator) {
+  public function __construct(
+    StateInterface $state,
+    FileUrlGeneratorInterface $file_url_generator,
+    TimeInterface $time = NULL,
+  ) {
     $this->state = $state;
     $this->fileUrlGenerator = $file_url_generator;
+    if (!$time) {
+      @trigger_error('Calling ' . __METHOD__ . '() without the $time argument is deprecated in drupal:9.4.0 and $time argument will be required in drupal:10.0.0. See https://www.drupal.org/node/3113971', E_USER_DEPRECATED);
+      $time = \Drupal::service(TimeInterface::class);
+    }
+    $this->time = $time;
   }
 
   /**
@@ -87,7 +104,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 : $this->time->getRequestTime());
           }
           break;
 
diff --git a/core/lib/Drupal/Core/Cache/ApcuBackend.php b/core/lib/Drupal/Core/Cache/ApcuBackend.php
index fc6fab38bfa..25a4f7ada1a 100644
--- a/core/lib/Drupal/Core/Cache/ApcuBackend.php
+++ b/core/lib/Drupal/Core/Cache/ApcuBackend.php
@@ -3,6 +3,7 @@
 namespace Drupal\Core\Cache;
 
 use Drupal\Component\Assertion\Inspector;
+use Drupal\Component\Datetime\TimeInterface;
 
 /**
  * Stores cache items in the Alternative PHP Cache User Cache (APCu).
@@ -39,6 +40,11 @@ class ApcuBackend implements CacheBackendInterface {
    */
   protected $checksumProvider;
 
+  /**
+   * The time service.
+   */
+  protected readonly TimeInterface $time;
+
   /**
    * Constructs a new ApcuBackend instance.
    *
@@ -48,12 +54,24 @@ class ApcuBackend implements CacheBackendInterface {
    *   The prefix to use for all keys in the storage that belong to this site.
    * @param \Drupal\Core\Cache\CacheTagsChecksumInterface $checksum_provider
    *   The cache tags checksum provider.
+   * @param \Drupal\Component\Datetime\TimeInterface|null $time
+   *   The time service.
    */
-  public function __construct($bin, $site_prefix, CacheTagsChecksumInterface $checksum_provider) {
+  public function __construct(
+    $bin,
+    $site_prefix,
+    CacheTagsChecksumInterface $checksum_provider,
+    TimeInterface $time = NULL,
+  ) {
     $this->bin = $bin;
     $this->sitePrefix = $site_prefix;
     $this->checksumProvider = $checksum_provider;
     $this->binPrefix = $this->sitePrefix . '::' . $this->bin . '::';
+    if (!$time) {
+      @trigger_error('Calling ' . __METHOD__ . '() without the $time argument is deprecated in drupal:9.4.0 and $time argument will be required in drupal:10.0.0. See https://www.drupal.org/node/3113971', E_USER_DEPRECATED);
+      $time = \Drupal::service(TimeInterface::class);
+    }
+    $this->time = $time;
   }
 
   /**
@@ -145,7 +163,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 >= $this->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 +253,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, $this->time->getRequestTime() - 1);
     }
   }
 
@@ -245,7 +263,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'], $this->time->getRequestTime() - 1);
     }
   }
 
diff --git a/core/lib/Drupal/Core/Cache/ApcuBackendFactory.php b/core/lib/Drupal/Core/Cache/ApcuBackendFactory.php
index 58b29015d7e..bdfbc451174 100644
--- a/core/lib/Drupal/Core/Cache/ApcuBackendFactory.php
+++ b/core/lib/Drupal/Core/Cache/ApcuBackendFactory.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Core\Cache;
 
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Core\Site\Settings;
 
 class ApcuBackendFactory implements CacheFactoryInterface {
@@ -27,6 +28,11 @@ class ApcuBackendFactory implements CacheFactoryInterface {
    */
   protected $backendClass;
 
+  /**
+   * The time service.
+   */
+  protected readonly TimeInterface $time;
+
   /**
    * Constructs an ApcuBackendFactory object.
    *
@@ -36,11 +42,18 @@ class ApcuBackendFactory implements CacheFactoryInterface {
    *   The site path.
    * @param \Drupal\Core\Cache\CacheTagsChecksumInterface $checksum_provider
    *   The cache tags checksum provider.
+   * @param \Drupal\Component\Datetime\TimeInterface|null $time
+   *   The time service.
    */
-  public function __construct($root, $site_path, CacheTagsChecksumInterface $checksum_provider) {
+  public function __construct($root, $site_path, CacheTagsChecksumInterface $checksum_provider, TimeInterface $time = NULL) {
     $this->sitePrefix = Settings::getApcuPrefix('apcu_backend', $root, $site_path);
     $this->checksumProvider = $checksum_provider;
     $this->backendClass = 'Drupal\Core\Cache\ApcuBackend';
+    if (!$time) {
+      @trigger_error('Calling ' . __METHOD__ . '() without the $time argument is deprecated in drupal:9.4.0 and $time argument will be required in drupal:10.0.0. See https://www.drupal.org/node/3113971', E_USER_DEPRECATED);
+      $time = \Drupal::service(TimeInterface::class);
+    }
+    $this->time = $time;
   }
 
   /**
@@ -53,7 +66,7 @@ public function __construct($root, $site_path, CacheTagsChecksumInterface $check
    *   The cache backend object for the specified cache bin.
    */
   public function get($bin) {
-    return new $this->backendClass($bin, $this->sitePrefix, $this->checksumProvider);
+    return new $this->backendClass($bin, $this->sitePrefix, $this->checksumProvider, $this->time);
   }
 
 }
diff --git a/core/lib/Drupal/Core/Cache/DatabaseBackend.php b/core/lib/Drupal/Core/Cache/DatabaseBackend.php
index f8d3f503c7b..0217d79fe5e 100644
--- a/core/lib/Drupal/Core/Cache/DatabaseBackend.php
+++ b/core/lib/Drupal/Core/Cache/DatabaseBackend.php
@@ -3,6 +3,7 @@
 namespace Drupal\Core\Cache;
 
 use Drupal\Component\Assertion\Inspector;
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Component\Utility\Crypt;
 use Drupal\Core\Database\Connection;
 use Drupal\Core\Database\DatabaseException;
@@ -61,6 +62,11 @@ class DatabaseBackend implements CacheBackendInterface {
    */
   protected $checksumProvider;
 
+  /**
+   * The time service.
+   */
+  protected readonly TimeInterface $time;
+
   /**
    * Constructs a DatabaseBackend object.
    *
@@ -73,8 +79,10 @@ class DatabaseBackend implements CacheBackendInterface {
    * @param int $max_rows
    *   (optional) The maximum number of rows that are allowed in this cache bin
    *   table.
+   * @param \Drupal\Component\Datetime\TimeInterface|null $time
+   *   The time service.
    */
-  public function __construct(Connection $connection, CacheTagsChecksumInterface $checksum_provider, $bin, $max_rows = NULL) {
+  public function __construct(Connection $connection, CacheTagsChecksumInterface $checksum_provider, $bin, $max_rows = NULL, TimeInterface $time = NULL) {
     // All cache tables should be prefixed with 'cache_'.
     $bin = 'cache_' . $bin;
 
@@ -82,6 +90,12 @@ public function __construct(Connection $connection, CacheTagsChecksumInterface $
     $this->connection = $connection;
     $this->checksumProvider = $checksum_provider;
     $this->maxRows = $max_rows === NULL ? static::DEFAULT_MAX_ROWS : $max_rows;
+
+    if (!$time) {
+      @trigger_error('Calling ' . __METHOD__ . '() without the $time argument is deprecated in drupal:9.4.0 and $time argument will be required in drupal:10.0.0. See https://www.drupal.org/node/3113971', E_USER_DEPRECATED);
+      $time = \Drupal::service(TimeInterface::class);
+    }
+    $this->time = $time;
   }
 
   /**
@@ -151,7 +165,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 >= $this->time->getRequestTime();
 
     // Check if invalidateTags() has been called with any of the item's tags.
     if (!$this->checksumProvider->isValid($cache->checksum, $cache->tags)) {
@@ -336,7 +350,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' => $this->time->getRequestTime() - 1])
           ->condition('cid', $cids_chunk, 'IN')
           ->execute();
       }
@@ -352,7 +366,7 @@ public function invalidateMultiple(array $cids) {
   public function invalidateAll() {
     try {
       $this->connection->update($this->bin)
-        ->fields(['expire' => REQUEST_TIME - 1])
+        ->fields(['expire' => $this->time->getRequestTime() - 1])
         ->execute();
     }
     catch (\Exception $e) {
@@ -383,7 +397,7 @@ public function garbageCollection() {
 
       $this->connection->delete($this->bin)
         ->condition('expire', Cache::PERMANENT, '<>')
-        ->condition('expire', REQUEST_TIME, '<')
+        ->condition('expire', $this->time->getRequestTime(), '<')
         ->execute();
     }
     catch (\Exception $e) {
diff --git a/core/lib/Drupal/Core/Cache/DatabaseBackendFactory.php b/core/lib/Drupal/Core/Cache/DatabaseBackendFactory.php
index 175639444c2..cf481eba5e1 100644
--- a/core/lib/Drupal/Core/Cache/DatabaseBackendFactory.php
+++ b/core/lib/Drupal/Core/Cache/DatabaseBackendFactory.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Core\Cache;
 
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Core\Database\Connection;
 use Drupal\Core\Site\Settings;
 
@@ -28,6 +29,11 @@ class DatabaseBackendFactory implements CacheFactoryInterface {
    */
   protected $settings;
 
+  /**
+   * The time service.
+   */
+  protected readonly TimeInterface $time;
+
   /**
    * Constructs the DatabaseBackendFactory object.
    *
@@ -37,13 +43,20 @@ class DatabaseBackendFactory implements CacheFactoryInterface {
    *   The cache tags checksum provider.
    * @param \Drupal\Core\Site\Settings $settings
    *   (optional) The site settings.
+   * @param \Drupal\Component\Datetime\TimeInterface|null $time
+   *   The time service.
    *
    * @throws \BadMethodCallException
    */
-  public function __construct(Connection $connection, CacheTagsChecksumInterface $checksum_provider, Settings $settings = NULL) {
+  public function __construct(Connection $connection, CacheTagsChecksumInterface $checksum_provider, Settings $settings = NULL, TimeInterface $time = NULL) {
     $this->connection = $connection;
     $this->checksumProvider = $checksum_provider;
     $this->settings = $settings ?: Settings::getInstance();
+    if (!$time) {
+      @trigger_error('Calling ' . __METHOD__ . '() without the $time argument is deprecated in drupal:9.4.0 and $time argument will be required in drupal:10.0.0. See https://www.drupal.org/node/3113971', E_USER_DEPRECATED);
+      $time = \Drupal::service(TimeInterface::class);
+    }
+    $this->time = $time;
   }
 
   /**
@@ -57,7 +70,7 @@ public function __construct(Connection $connection, CacheTagsChecksumInterface $
    */
   public function get($bin) {
     $max_rows = $this->getMaxRowsForBin($bin);
-    return new DatabaseBackend($this->connection, $this->checksumProvider, $bin, $max_rows);
+    return new DatabaseBackend($this->connection, $this->checksumProvider, $bin, $max_rows, $this->time);
   }
 
   /**
diff --git a/core/lib/Drupal/Core/Cache/MemoryBackend.php b/core/lib/Drupal/Core/Cache/MemoryBackend.php
index 18e3658d323..97260eba483 100644
--- a/core/lib/Drupal/Core/Cache/MemoryBackend.php
+++ b/core/lib/Drupal/Core/Cache/MemoryBackend.php
@@ -3,6 +3,7 @@
 namespace Drupal\Core\Cache;
 
 use Drupal\Component\Assertion\Inspector;
+use Drupal\Component\Datetime\TimeInterface;
 
 /**
  * Defines a memory cache implementation.
@@ -26,6 +27,25 @@ class MemoryBackend implements CacheBackendInterface, CacheTagsInvalidatorInterf
    */
   protected $cache = [];
 
+  /**
+   * The time service.
+   */
+  protected readonly TimeInterface $time;
+
+  /**
+   * Constructs a MemoryBackend object.
+   *
+   * @param \Drupal\Component\Datetime\TimeInterface|null $time
+   *   The time service.
+   */
+  public function __construct(TimeInterface $time = NULL) {
+    if (!$time) {
+      @trigger_error('Calling ' . static::class . '::__construct() without the $time argument is deprecated in drupal:9.4.0 and $time argument will be required in drupal:10.0.0. See https://www.drupal.org/node/3113971', E_USER_DEPRECATED);
+      $time = \Drupal::service(TimeInterface::class);
+    }
+    $this->time = $time;
+  }
+
   /**
    * {@inheritdoc}
    */
@@ -87,7 +107,7 @@ protected function prepareItem($cache, $allow_invalid) {
     $prepared->data = unserialize($prepared->data);
 
     // Check expire time.
-    $prepared->valid = $prepared->expire == Cache::PERMANENT || $prepared->expire >= $this->getRequestTime();
+    $prepared->valid = $prepared->expire == Cache::PERMANENT || $prepared->expire >= $this->time->getRequestTime();
 
     if (!$allow_invalid && !$prepared->valid) {
       return FALSE;
@@ -107,7 +127,7 @@ public function set($cid, $data, $expire = Cache::PERMANENT, array $tags = []) {
     $this->cache[$cid] = (object) [
       'cid' => $cid,
       'data' => serialize($data),
-      'created' => $this->getRequestTime(),
+      'created' => $this->time->getRequestTime(),
       'expire' => $expire,
       'tags' => $tags,
     ];
@@ -148,7 +168,7 @@ public function deleteAll() {
    */
   public function invalidate($cid) {
     if (isset($this->cache[$cid])) {
-      $this->cache[$cid]->expire = $this->getRequestTime() - 1;
+      $this->cache[$cid]->expire = $this->time->getRequestTime() - 1;
     }
   }
 
@@ -158,7 +178,7 @@ public function invalidate($cid) {
   public function invalidateMultiple(array $cids) {
     $items = array_intersect_key($this->cache, array_flip($cids));
     foreach ($items as $cid => $item) {
-      $this->cache[$cid]->expire = $this->getRequestTime() - 1;
+      $this->cache[$cid]->expire = $this->time->getRequestTime() - 1;
     }
   }
 
@@ -168,7 +188,7 @@ public function invalidateMultiple(array $cids) {
   public function invalidateTags(array $tags) {
     foreach ($this->cache as $cid => $item) {
       if (array_intersect($tags, $item->tags)) {
-        $this->cache[$cid]->expire = $this->getRequestTime() - 1;
+        $this->cache[$cid]->expire = $this->time->getRequestTime() - 1;
       }
     }
   }
@@ -178,7 +198,7 @@ public function invalidateTags(array $tags) {
    */
   public function invalidateAll() {
     foreach ($this->cache as $cid => $item) {
-      $this->cache[$cid]->expire = $this->getRequestTime() - 1;
+      $this->cache[$cid]->expire = $this->time->getRequestTime() - 1;
     }
   }
 
@@ -201,14 +221,15 @@ public function removeBin() {
    * @return int
    */
   protected function getRequestTime() {
-    return defined('REQUEST_TIME') ? REQUEST_TIME : (int) $_SERVER['REQUEST_TIME'];
+    @trigger_error(__METHOD__ . '() is deprecated in drupal:9.4.0 will be removed in drupal:10.0.0. Use the datetime.time service instead. See https://www.drupal.org/node/3113971', E_USER_DEPRECATED);
+    return $this->time->getRequestTime();
   }
 
   /**
    * Prevents data stored in memory backends from being serialized.
    */
   public function __sleep() {
-    return [];
+    return ['time'];
   }
 
   /**
diff --git a/core/lib/Drupal/Core/Cache/MemoryBackendFactory.php b/core/lib/Drupal/Core/Cache/MemoryBackendFactory.php
index c5c6a950a4c..8c5db32e4ff 100644
--- a/core/lib/Drupal/Core/Cache/MemoryBackendFactory.php
+++ b/core/lib/Drupal/Core/Cache/MemoryBackendFactory.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Core\Cache;
 
+use Drupal\Component\Datetime\TimeInterface;
+
 class MemoryBackendFactory implements CacheFactoryInterface {
 
   /**
@@ -11,12 +13,31 @@ class MemoryBackendFactory implements CacheFactoryInterface {
    */
   protected $bins = [];
 
+  /**
+   * The time service.
+   */
+  protected readonly TimeInterface $time;
+
+  /**
+   * Constructs a MemoryBackendFactory object.
+   *
+   * @param \Drupal\Component\Datetime\TimeInterface|null $time
+   *   The time service.
+   */
+  public function __construct(TimeInterface $time = NULL) {
+    if (!$time) {
+      @trigger_error('Calling ' . __METHOD__ . '() without the $time argument is deprecated in drupal:9.4.0 and $time argument will be required in drupal:10.0.0. See https://www.drupal.org/node/3113971', E_USER_DEPRECATED);
+      $time = \Drupal::service(TimeInterface::class);
+    }
+    $this->time = $time;
+  }
+
   /**
    * {@inheritdoc}
    */
   public function get($bin) {
     if (!isset($this->bins[$bin])) {
-      $this->bins[$bin] = new MemoryBackend();
+      $this->bins[$bin] = new MemoryBackend($this->time);
     }
     return $this->bins[$bin];
   }
diff --git a/core/lib/Drupal/Core/Cache/MemoryCache/MemoryCache.php b/core/lib/Drupal/Core/Cache/MemoryCache/MemoryCache.php
index 32711082115..a5772e6d3e0 100644
--- a/core/lib/Drupal/Core/Cache/MemoryCache/MemoryCache.php
+++ b/core/lib/Drupal/Core/Cache/MemoryCache/MemoryCache.php
@@ -35,7 +35,7 @@ protected function prepareItem($cache, $allow_invalid = FALSE) {
       return FALSE;
     }
     // Check expire time.
-    $cache->valid = $cache->expire == static::CACHE_PERMANENT || $cache->expire >= $this->getRequestTime();
+    $cache->valid = $cache->expire == static::CACHE_PERMANENT || $cache->expire >= $this->time->getRequestTime();
 
     if (!$allow_invalid && !$cache->valid) {
       return FALSE;
@@ -54,7 +54,7 @@ public function set($cid, $data, $expire = MemoryCacheInterface::CACHE_PERMANENT
     $this->cache[$cid] = (object) [
       'cid' => $cid,
       'data' => $data,
-      'created' => $this->getRequestTime(),
+      'created' => $this->time->getRequestTime(),
       'expire' => $expire,
       'tags' => $tags,
     ];
diff --git a/core/lib/Drupal/Core/Cache/MemoryCounterBackendFactory.php b/core/lib/Drupal/Core/Cache/MemoryCounterBackendFactory.php
index 02d0197ea7c..f7d7376bddd 100644
--- a/core/lib/Drupal/Core/Cache/MemoryCounterBackendFactory.php
+++ b/core/lib/Drupal/Core/Cache/MemoryCounterBackendFactory.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Core\Cache;
 
+use Drupal\Component\Datetime\TimeInterface;
+
 class MemoryCounterBackendFactory implements CacheFactoryInterface {
 
   /**
@@ -11,12 +13,31 @@ class MemoryCounterBackendFactory implements CacheFactoryInterface {
    */
   protected $bins = [];
 
+  /**
+   * The time service.
+   */
+  protected readonly TimeInterface $time;
+
+  /**
+   * Constructs a MemoryCounterBackendFactory object.
+   *
+   * @param \Drupal\Component\Datetime\TimeInterface|null $time
+   *   The time service.
+   */
+  public function __construct(TimeInterface $time = NULL) {
+    if (!$time) {
+      @trigger_error('Calling ' . __METHOD__ . '() without the $time argument is deprecated in drupal:9.4.0 and $time argument will be required in drupal:10.0.0. See https://www.drupal.org/node/3113971', E_USER_DEPRECATED);
+      $time = \Drupal::service(TimeInterface::class);
+    }
+    $this->time = $time;
+  }
+
   /**
    * {@inheritdoc}
    */
   public function get($bin) {
     if (!isset($this->bins[$bin])) {
-      $this->bins[$bin] = new MemoryCounterBackend();
+      $this->bins[$bin] = new MemoryCounterBackend($this->time);
     }
     return $this->bins[$bin];
   }
diff --git a/core/lib/Drupal/Core/Cache/PhpBackend.php b/core/lib/Drupal/Core/Cache/PhpBackend.php
index a6b69acface..c1eb4f85d50 100644
--- a/core/lib/Drupal/Core/Cache/PhpBackend.php
+++ b/core/lib/Drupal/Core/Cache/PhpBackend.php
@@ -3,6 +3,7 @@
 namespace Drupal\Core\Cache;
 
 use Drupal\Component\Assertion\Inspector;
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Component\PhpStorage\PhpStorageInterface;
 use Drupal\Component\Utility\Crypt;
 use Drupal\Core\PhpStorage\PhpStorageFactory;
@@ -44,6 +45,11 @@ class PhpBackend implements CacheBackendInterface {
    */
   protected $checksumProvider;
 
+  /**
+   * The time service.
+   */
+  protected readonly TimeInterface $time;
+
   /**
    * Constructs a PhpBackend object.
    *
@@ -51,10 +57,17 @@ class PhpBackend implements CacheBackendInterface {
    *   The cache bin for which the object is created.
    * @param \Drupal\Core\Cache\CacheTagsChecksumInterface $checksum_provider
    *   The cache tags checksum provider.
+   * @param \Drupal\Component\Datetime\TimeInterface|null $time
+   *   The time service.
    */
-  public function __construct($bin, CacheTagsChecksumInterface $checksum_provider) {
+  public function __construct($bin, CacheTagsChecksumInterface $checksum_provider, TimeInterface $time = NULL) {
     $this->bin = 'cache_' . $bin;
     $this->checksumProvider = $checksum_provider;
+    if (!$time) {
+      @trigger_error('Calling ' . __METHOD__ . '() without the $time argument is deprecated in drupal:9.4.0 and $time argument will be required in drupal:10.0.0. See https://www.drupal.org/node/3113971', E_USER_DEPRECATED);
+      $time = \Drupal::service(TimeInterface::class);
+    }
+    $this->time = $time;
   }
 
   /**
@@ -132,7 +145,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 >= $this->time->getRequestTime();
 
     // Check if invalidateTags() has been called with any of the item's tags.
     if (!$this->checksumProvider->isValid($cache->checksum, $cache->tags)) {
@@ -201,7 +214,7 @@ public function invalidate($cid) {
    */
   protected function invalidateByHash($cidhash) {
     if ($item = $this->getByHash($cidhash)) {
-      $item->expire = REQUEST_TIME - 1;
+      $item->expire = $this->time->getRequestTime() - 1;
       $this->writeItem($cidhash, $item);
     }
   }
diff --git a/core/lib/Drupal/Core/Cache/PhpBackendFactory.php b/core/lib/Drupal/Core/Cache/PhpBackendFactory.php
index 0091ed307de..5f0a04f4ebf 100644
--- a/core/lib/Drupal/Core/Cache/PhpBackendFactory.php
+++ b/core/lib/Drupal/Core/Cache/PhpBackendFactory.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Core\Cache;
 
+use Drupal\Component\Datetime\TimeInterface;
+
 class PhpBackendFactory implements CacheFactoryInterface {
 
   /**
@@ -11,14 +13,26 @@ class PhpBackendFactory implements CacheFactoryInterface {
    */
   protected $checksumProvider;
 
+  /**
+   * The time service.
+   */
+  protected readonly TimeInterface $time;
+
   /**
    * Constructs a PhpBackendFactory object.
    *
    * @param \Drupal\Core\Cache\CacheTagsChecksumInterface $checksum_provider
    *   The cache tags checksum provider.
+   * @param \Drupal\Component\Datetime\TimeInterface|null $time
+   *   The time service.
    */
-  public function __construct(CacheTagsChecksumInterface $checksum_provider) {
+  public function __construct(CacheTagsChecksumInterface $checksum_provider, TimeInterface $time = NULL) {
     $this->checksumProvider = $checksum_provider;
+    if (!$time) {
+      @trigger_error('Calling ' . __METHOD__ . '() without the $time argument is deprecated in drupal:9.4.0 and $time argument will be required in drupal:10.0.0. See https://www.drupal.org/node/3113971', E_USER_DEPRECATED);
+      $time = \Drupal::service(TimeInterface::class);
+    }
+    $this->time = $time;
   }
 
   /**
@@ -31,7 +45,7 @@ public function __construct(CacheTagsChecksumInterface $checksum_provider) {
    *   The cache backend object for the specified cache bin.
    */
   public function get($bin) {
-    return new PhpBackend($bin, $this->checksumProvider);
+    return new PhpBackend($bin, $this->checksumProvider, $this->time);
   }
 
 }
diff --git a/core/lib/Drupal/Core/Config/StorageComparer.php b/core/lib/Drupal/Core/Config/StorageComparer.php
index 51f7bec937d..9a303394a15 100644
--- a/core/lib/Drupal/Core/Config/StorageComparer.php
+++ b/core/lib/Drupal/Core/Config/StorageComparer.php
@@ -2,9 +2,12 @@
 
 namespace Drupal\Core\Config;
 
+use Drupal\Component\Datetime\Time;
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Core\Cache\MemoryBackend;
 use Drupal\Core\Config\Entity\ConfigDependencyManager;
 use Drupal\Core\DependencyInjection\DependencySerializationTrait;
+use Symfony\Component\HttpFoundation\RequestStack;
 
 /**
  * Defines a config storage comparer.
@@ -99,12 +102,18 @@ public function __construct(StorageInterface $source_storage, StorageInterface $
 
     // Wrap the storages in a static cache so that multiple reads of the same
     // raw configuration object are not costly.
-    $this->sourceCacheStorage = new MemoryBackend();
+    if (\Drupal::hasService(TimeInterface::class)) {
+      $time = \Drupal::service(TimeInterface::class);
+    }
+    else {
+      $time = new Time(\Drupal::hasService('request_stack') ? \Drupal::service('request_stack') : new RequestStack());
+    }
+    $this->sourceCacheStorage = new MemoryBackend($time);
     $this->sourceStorage = new CachedStorage(
       $source_storage,
       $this->sourceCacheStorage
     );
-    $this->targetCacheStorage = new MemoryBackend();
+    $this->targetCacheStorage = new MemoryBackend($time);
     $this->targetStorage = new CachedStorage(
       $target_storage,
       $this->targetCacheStorage
diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php
index c6f0b9846d9..67c21f1a245 100644
--- a/core/lib/Drupal/Core/DrupalKernel.php
+++ b/core/lib/Drupal/Core/DrupalKernel.php
@@ -72,9 +72,16 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface {
         'factory' => 'Drupal\Core\Database\Database::getConnection',
         'arguments' => ['default'],
       ],
+      'request_stack' => [
+        'class' => 'Symfony\Component\HttpFoundation\RequestStack',
+      ],
+      'datetime.time' => [
+        'class' => 'Drupal\Component\Datetime\Time',
+        'arguments' => ['@request_stack'],
+      ],
       'cache.container' => [
         'class' => 'Drupal\Core\Cache\DatabaseBackend',
-        'arguments' => ['@database', '@cache_tags_provider.container', 'container', DatabaseBackend::MAXIMUM_NONE],
+        'arguments' => ['@database', '@cache_tags_provider.container', 'container', DatabaseBackend::MAXIMUM_NONE, '@datetime.time'],
       ],
       'cache_tags_provider.container' => [
         'class' => 'Drupal\Core\Cache\DatabaseCacheTagsChecksum',
diff --git a/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php
index b5fc2aaf25a..03fa532dfe0 100644
--- a/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php
+++ b/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php
@@ -3,6 +3,7 @@
 namespace Drupal\Core\EventSubscriber;
 
 use Drupal\Component\Datetime\DateTimePlus;
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Core\Cache\CacheableResponseInterface;
 use Drupal\Core\Cache\Context\CacheContextsManager;
 use Drupal\Core\Config\ConfigFactoryInterface;
@@ -61,6 +62,11 @@ class FinishResponseSubscriber implements EventSubscriberInterface {
    */
   protected $debugCacheabilityHeaders = FALSE;
 
+  /**
+   * The time service.
+   */
+  protected readonly TimeInterface $time;
+
   /**
    * Constructs a FinishResponseSubscriber object.
    *
@@ -76,14 +82,21 @@ class FinishResponseSubscriber implements EventSubscriberInterface {
    *   The cache contexts manager service.
    * @param bool $http_response_debug_cacheability_headers
    *   (optional) Whether to send cacheability headers for debugging purposes.
+   * @param \Drupal\Component\Datetime\TimeInterface|null $time
+   *   The time service
    */
-  public function __construct(LanguageManagerInterface $language_manager, ConfigFactoryInterface $config_factory, RequestPolicyInterface $request_policy, ResponsePolicyInterface $response_policy, CacheContextsManager $cache_contexts_manager, $http_response_debug_cacheability_headers = FALSE) {
+  public function __construct(LanguageManagerInterface $language_manager, ConfigFactoryInterface $config_factory, RequestPolicyInterface $request_policy, ResponsePolicyInterface $response_policy, CacheContextsManager $cache_contexts_manager, $http_response_debug_cacheability_headers = FALSE, TimeInterface $time = NULL) {
     $this->languageManager = $language_manager;
     $this->config = $config_factory->get('system.performance');
     $this->requestPolicy = $request_policy;
     $this->responsePolicy = $response_policy;
     $this->cacheContextsManager = $cache_contexts_manager;
     $this->debugCacheabilityHeaders = $http_response_debug_cacheability_headers;
+    if (!$time) {
+      @trigger_error('Calling ' . __METHOD__ . '() without the $time argument is deprecated in drupal:9.4.0 and $time argument will be required in drupal:10.0.0. See https://www.drupal.org/node/3113971', E_USER_DEPRECATED);
+      $time = \Drupal::service(TimeInterface::class);
+    }
+    $this->time = $time;
   }
 
   /**
@@ -255,8 +268,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 = $this->time->getRequestTime();
+      $response->setLastModified(new \DateTime(gmdate(DateTimePlus::RFC7231, $this->time->getRequestTime())));
     }
     else {
       $timestamp = $response->getLastModified()->getTimestamp();
diff --git a/core/lib/Drupal/Core/Flood/DatabaseBackend.php b/core/lib/Drupal/Core/Flood/DatabaseBackend.php
index dedb6724d7a..e1dc7f0b23a 100644
--- a/core/lib/Drupal/Core/Flood/DatabaseBackend.php
+++ b/core/lib/Drupal/Core/Flood/DatabaseBackend.php
@@ -2,9 +2,10 @@
 
 namespace Drupal\Core\Flood;
 
+use Drupal\Component\Datetime\TimeInterface;
+use Drupal\Core\Database\Connection;
 use Drupal\Core\Database\DatabaseException;
 use Symfony\Component\HttpFoundation\RequestStack;
-use Drupal\Core\Database\Connection;
 
 /**
  * Defines the database flood backend. This is the default Drupal backend.
@@ -30,6 +31,11 @@ class DatabaseBackend implements FloodInterface, PrefixFloodInterface {
    */
   protected $requestStack;
 
+  /**
+   * The time service.
+   */
+  protected readonly TimeInterface $time;
+
   /**
    * Construct the DatabaseBackend.
    *
@@ -38,10 +44,17 @@ class DatabaseBackend implements FloodInterface, PrefixFloodInterface {
    *   information.
    * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack
    *   The request stack used to retrieve the current request.
+   * @param \Drupal\Component\Datetime\TimeInterface|null $time
+   *   The time service.
    */
-  public function __construct(Connection $connection, RequestStack $request_stack) {
+  public function __construct(Connection $connection, RequestStack $request_stack, TimeInterface $time = NULL) {
     $this->connection = $connection;
     $this->requestStack = $request_stack;
+    if (!$time) {
+      @trigger_error('Calling ' . __METHOD__ . '() without the $time argument is deprecated in drupal:9.4.0 and $time argument will be required in drupal:10.0.0. See https://www.drupal.org/node/3113971', E_USER_DEPRECATED);
+      $time = \Drupal::service(TimeInterface::class);
+    }
+    $this->time = $time;
   }
 
   /**
@@ -83,8 +96,8 @@ protected function doInsert($name, $window, $identifier) {
       ->fields([
         'event' => $name,
         'identifier' => $identifier,
-        'timestamp' => REQUEST_TIME,
-        'expiration' => REQUEST_TIME + $window,
+        'timestamp' => $this->time->getRequestTime(),
+        'expiration' => $this->time->getRequestTime() + $window,
       ])
       ->execute();
   }
@@ -133,7 +146,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', $this->time->getRequestTime() - $window, '>')
         ->countQuery()
         ->execute()
         ->fetchField();
@@ -151,7 +164,7 @@ public function isAllowed($name, $threshold, $window = 3600, $identifier = NULL)
   public function garbageCollection() {
     try {
       $this->connection->delete(static::TABLE_NAME)
-        ->condition('expiration', REQUEST_TIME, '<')
+        ->condition('expiration', $this->time->getRequestTime(), '<')
         ->execute();
     }
     catch (\Exception $e) {
diff --git a/core/lib/Drupal/Core/Installer/NormalInstallerServiceProvider.php b/core/lib/Drupal/Core/Installer/NormalInstallerServiceProvider.php
index 507b27c7c4f..ae66aa24c0e 100644
--- a/core/lib/Drupal/Core/Installer/NormalInstallerServiceProvider.php
+++ b/core/lib/Drupal/Core/Installer/NormalInstallerServiceProvider.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Core\Installer;
 
+use Drupal\Component\Datetime\Time;
 use Drupal\Core\Cache\MemoryBackendFactory;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\DependencyInjection\ServiceProviderInterface;
@@ -12,6 +13,7 @@
 use Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass;
 use Symfony\Component\DependencyInjection\Compiler\ResolveHotPathPass;
 use Symfony\Component\DependencyInjection\Reference;
+use Symfony\Component\HttpFoundation\RequestStack;
 
 /**
  * Service provider for the installer environment.
@@ -37,7 +39,7 @@ public function register(ContainerBuilder $container) {
     // install.
     $definition = $container->getDefinition('cache_factory');
     $definition->setClass(MemoryBackendFactory::class);
-    $definition->setArguments([]);
+    $definition->setArguments([new Time(new RequestStack())]);
     $definition->setMethodCalls([]);
 
     // Replace lock service with no-op implementation as Drupal installation can
diff --git a/core/lib/Drupal/Core/KeyValueStore/KeyValueDatabaseExpirableFactory.php b/core/lib/Drupal/Core/KeyValueStore/KeyValueDatabaseExpirableFactory.php
index 207a339fcb4..6714a3965ec 100644
--- a/core/lib/Drupal/Core/KeyValueStore/KeyValueDatabaseExpirableFactory.php
+++ b/core/lib/Drupal/Core/KeyValueStore/KeyValueDatabaseExpirableFactory.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Core\KeyValueStore;
 
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Component\Serialization\SerializationInterface;
 use Drupal\Core\Database\Connection;
 
@@ -31,6 +32,11 @@ class KeyValueDatabaseExpirableFactory implements KeyValueExpirableFactoryInterf
    */
   protected $connection;
 
+  /**
+   * The time service.
+   */
+  protected readonly TimeInterface $time;
+
   /**
    * Constructs this factory object.
    *
@@ -38,10 +44,21 @@ class KeyValueDatabaseExpirableFactory implements KeyValueExpirableFactoryInterf
    *   The serialization class to use.
    * @param \Drupal\Core\Database\Connection $connection
    *   The Connection object containing the key-value tables.
+   * @param \Drupal\Component\Datetime\TimeInterface|null $time
+   *   The time service.
    */
-  public function __construct(SerializationInterface $serializer, Connection $connection) {
+  public function __construct(
+    SerializationInterface $serializer,
+    Connection $connection,
+    TimeInterface $time = NULL,
+  ) {
     $this->serializer = $serializer;
     $this->connection = $connection;
+    if (!$time) {
+      @trigger_error('Calling ' . __METHOD__ . '() without the $time argument is deprecated in drupal:9.4.0 and $time argument will be required in drupal:10.0.0. See https://www.drupal.org/node/3113971', E_USER_DEPRECATED);
+      $time = \Drupal::service(TimeInterface::class);
+    }
+    $this->time = $time;
   }
 
   /**
@@ -60,7 +77,7 @@ public function get($collection) {
   public function garbageCollection() {
     try {
       $this->connection->delete('key_value_expire')
-        ->condition('expire', REQUEST_TIME, '<')
+        ->condition('expire', $this->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 9917cdb079d..d796dd5a17f 100644
--- a/core/lib/Drupal/Core/Session/SessionHandler.php
+++ b/core/lib/Drupal/Core/Session/SessionHandler.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Core\Session;
 
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Component\Utility\Crypt;
 use Drupal\Core\Database\Connection;
 use Drupal\Core\DependencyInjection\DependencySerializationTrait;
@@ -30,6 +31,11 @@ class SessionHandler extends AbstractProxy implements \SessionHandlerInterface {
    */
   protected $connection;
 
+  /**
+   * The time service.
+   */
+  protected readonly TimeInterface $time;
+
   /**
    * Constructs a new SessionHandler instance.
    *
@@ -37,10 +43,17 @@ class SessionHandler extends AbstractProxy implements \SessionHandlerInterface {
    *   The request stack.
    * @param \Drupal\Core\Database\Connection $connection
    *   The database connection.
+   * @param \Drupal\Component\Datetime\TimeInterface|null $time
+   *   The time service.
    */
-  public function __construct(RequestStack $request_stack, Connection $connection) {
+  public function __construct(RequestStack $request_stack, Connection $connection, TimeInterface $time = NULL) {
     $this->requestStack = $request_stack;
     $this->connection = $connection;
+    if (!$time) {
+      @trigger_error('Calling ' . __METHOD__ . '() without the $time argument is deprecated in drupal:9.4.0 and $time argument will be required in drupal:10.0.0. See https://www.drupal.org/node/3113971', E_USER_DEPRECATED);
+      $time = \Drupal::service(TimeInterface::class);
+    }
+    $this->time = $time;
   }
 
   /**
@@ -79,7 +92,7 @@ public function write(#[\SensitiveParameter] $sid, $value) {
         'uid' => $request->getSession()->get('uid', 0),
         'hostname' => $request->getClientIP(),
         'session' => $value,
-        'timestamp' => REQUEST_TIME,
+        'timestamp' => $this->time->getRequestTime(),
       ];
       $this->connection->merge('sessions')
         ->keys(['sid' => Crypt::hashBase64($sid)])
@@ -131,7 +144,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', $this->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 88cd771dda4..3fff895bd69 100644
--- a/core/lib/Drupal/Core/Session/SessionManager.php
+++ b/core/lib/Drupal/Core/Session/SessionManager.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Core\Session;
 
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Core\Database\Connection;
 use Drupal\Core\DependencyInjection\DependencySerializationTrait;
 use Symfony\Component\HttpFoundation\RequestStack;
@@ -66,6 +67,11 @@ class SessionManager extends NativeSessionStorage implements SessionManagerInter
    */
   protected $writeSafeHandler;
 
+  /**
+   * The time service.
+   */
+  protected readonly TimeInterface $time;
+
   /**
    * Constructs a new session manager instance.
    *
@@ -79,13 +85,21 @@ class SessionManager extends NativeSessionStorage implements SessionManagerInter
    *   The session configuration interface.
    * @param \Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy|\SessionHandlerInterface|null $handler
    *   The object to register as a PHP session handler.
-   *   @see \Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage::setSaveHandler()
+   * @param \Drupal\Component\Datetime\TimeInterface|null $time
+   *   The time service.
+   *
+   * @see \Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage::setSaveHandler()
    */
-  public function __construct(RequestStack $request_stack, Connection $connection, MetadataBag $metadata_bag, SessionConfigurationInterface $session_configuration, $handler = NULL) {
+  public function __construct(RequestStack $request_stack, Connection $connection, MetadataBag $metadata_bag, SessionConfigurationInterface $session_configuration, $handler = NULL, TimeInterface $time = NULL) {
     $options = [];
     $this->sessionConfiguration = $session_configuration;
     $this->requestStack = $request_stack;
     $this->connection = $connection;
+    if (!$time) {
+      @trigger_error('Calling ' . __METHOD__ . '() without the $time argument is deprecated in drupal:9.4.0 and $time argument will be required in drupal:10.0.0. See https://www.drupal.org/node/3113971', E_USER_DEPRECATED);
+      $time = \Drupal::service(TimeInterface::class);
+    }
+    $this->time = $time;
 
     parent::__construct($options, $handler, $metadata_bag);
   }
@@ -242,7 +256,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, '', $this->time->getRequestTime() - 3600, $params['path'], $params['domain'], $params['secure'], $params['httponly']);
       $cookies->remove($session_name);
     }
   }
diff --git a/core/modules/book/book.services.yml b/core/modules/book/book.services.yml
index 780a6bffa4b..95df6c9e1ee 100644
--- a/core/modules/book/book.services.yml
+++ b/core/modules/book/book.services.yml
@@ -42,6 +42,7 @@ services:
     arguments: ['@book.outline_storage', '@entity_type.manager', '@string_translation']
     lazy: true
   book.memory_cache:
+    autowire: true
     class: Drupal\Core\Cache\MemoryCache\MemoryCache
   book.backend_chained_cache:
     class: Drupal\Core\Cache\BackendChain
diff --git a/core/modules/comment/comment.services.yml b/core/modules/comment/comment.services.yml
index f356ea1b7ab..dec8d68cd73 100644
--- a/core/modules/comment/comment.services.yml
+++ b/core/modules/comment/comment.services.yml
@@ -11,6 +11,7 @@ services:
   Drupal\comment\CommentManagerInterface: '@comment.manager'
 
   comment.statistics:
+    autowire: true
     class: Drupal\comment\CommentStatistics
     arguments: ['@database', '@current_user', '@entity_type.manager', '@state', '@database.replica']
     tags:
diff --git a/core/modules/comment/src/CommentStatistics.php b/core/modules/comment/src/CommentStatistics.php
index 5b38f4549ea..422d346451c 100644
--- a/core/modules/comment/src/CommentStatistics.php
+++ b/core/modules/comment/src/CommentStatistics.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\comment;
 
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Core\Database\Connection;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\Core\Entity\FieldableEntityInterface;
@@ -48,6 +49,11 @@ class CommentStatistics implements CommentStatisticsInterface {
    */
   protected $state;
 
+  /**
+   * The time service.
+   */
+  protected readonly TimeInterface $time;
+
   /**
    * Constructs the CommentStatistics service.
    *
@@ -61,13 +67,27 @@ class CommentStatistics implements CommentStatisticsInterface {
    *   The state service.
    * @param \Drupal\Core\Database\Connection|null $database_replica
    *   (Optional) the replica database connection.
+   * @param \Drupal\Component\Datetime\TimeInterface|null $time
+   *   The time service.
    */
-  public function __construct(Connection $database, AccountInterface $current_user, EntityTypeManagerInterface $entity_type_manager, StateInterface $state, Connection $database_replica = NULL) {
+  public function __construct(
+    Connection $database,
+    AccountInterface $current_user,
+    EntityTypeManagerInterface $entity_type_manager,
+    StateInterface $state,
+    Connection $database_replica = NULL,
+    TimeInterface $time = NULL,
+  ) {
     $this->database = $database;
     $this->databaseReplica = $database_replica ?: $database;
     $this->currentUser = $current_user;
     $this->entityTypeManager = $entity_type_manager;
     $this->state = $state;
+    if (!$time) {
+      @trigger_error('Calling ' . __METHOD__ . '() without the $time argument is deprecated in drupal:9.4.0 and $time argument will be required in drupal:10.0.0. See https://www.drupal.org/node/3113971', E_USER_DEPRECATED);
+      $time = \Drupal::service(TimeInterface::class);
+    }
+    $this->time = $time;
   }
 
   /**
@@ -129,8 +149,8 @@ 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 request time when entity does not have a changed property.
+      $last_comment_timestamp = $this->time->getRequestTime();
       // @todo Make comment statistics language aware and add some tests. See
       //   https://www.drupal.org/node/2318875
       if ($entity instanceof EntityChangedInterface) {
@@ -251,8 +271,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,
+          // request time.
+          'last_comment_timestamp' => ($entity instanceof EntityChangedInterface) ? $entity->getChangedTimeAcrossTranslations() : $this->time->getRequestTime(),
           'last_comment_name' => '',
           'last_comment_uid' => $last_comment_uid,
         ])
diff --git a/core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php b/core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php
index dc20d233616..04f1901bc5d 100644
--- a/core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php
+++ b/core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php
@@ -3,6 +3,7 @@
 namespace Drupal\Tests\comment\Unit;
 
 use Drupal\comment\CommentStatistics;
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\Tests\UnitTestCase;
 
@@ -85,7 +86,7 @@ protected function setUp(): void {
       ->method('select')
       ->willReturn($this->select);
 
-    $this->commentStatistics = new CommentStatistics($this->database, $this->createMock('Drupal\Core\Session\AccountInterface'), $this->createMock(EntityTypeManagerInterface::class), $this->createMock('Drupal\Core\State\StateInterface'), $this->database);
+    $this->commentStatistics = new CommentStatistics($this->database, $this->createMock('Drupal\Core\Session\AccountInterface'), $this->createMock(EntityTypeManagerInterface::class), $this->createMock('Drupal\Core\State\StateInterface'), $this->database, $this->createMock(TimeInterface::class));
   }
 
   /**
diff --git a/core/modules/jsonapi/jsonapi.services.yml b/core/modules/jsonapi/jsonapi.services.yml
index c989066498a..893c38cdc70 100644
--- a/core/modules/jsonapi/jsonapi.services.yml
+++ b/core/modules/jsonapi/jsonapi.services.yml
@@ -124,6 +124,7 @@ services:
 
   # Cache.
   cache.jsonapi_memory:
+    autowire: true
     class: Drupal\Core\Cache\MemoryCache\MemoryCache
     public: false
 
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateSqlSourceTestBase.php b/core/modules/migrate/tests/src/Kernel/MigrateSqlSourceTestBase.php
index ba11c234a66..52bf6fb1d0b 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateSqlSourceTestBase.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateSqlSourceTestBase.php
@@ -5,6 +5,7 @@
 use Drupal\Core\Cache\MemoryCounterBackendFactory;
 use Drupal\sqlite\Driver\Database\sqlite\Connection;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Reference;
 
 /**
  * Base class for tests of Migrate source plugins that use a database.
@@ -16,7 +17,9 @@ abstract class MigrateSqlSourceTestBase extends MigrateSourceTestBase {
    */
   public function register(ContainerBuilder $container) {
     parent::register($container);
-    $container->register('cache_factory', MemoryCounterBackendFactory::class);
+    $container
+      ->register('cache_factory', MemoryCounterBackendFactory::class)
+      ->addArgument(new Reference('datetime.time'));
   }
 
   /**
diff --git a/core/modules/mysql/tests/src/Kernel/mysql/DbDumpTest.php b/core/modules/mysql/tests/src/Kernel/mysql/DbDumpTest.php
index 308d4813728..e390380ca71 100644
--- a/core/modules/mysql/tests/src/Kernel/mysql/DbDumpTest.php
+++ b/core/modules/mysql/tests/src/Kernel/mysql/DbDumpTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\mysql\Kernel\mysql;
 
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Component\Render\FormattableMarkup;
 use Drupal\Core\Command\DbDumpApplication;
 use Drupal\Core\Config\DatabaseStorage;
@@ -75,7 +76,8 @@ public function register(ContainerBuilder $container) {
     $container->register('cache_factory', 'Drupal\Core\Cache\DatabaseBackendFactory')
       ->addArgument(new Reference('database'))
       ->addArgument(new Reference('cache_tags.invalidator.checksum'))
-      ->addArgument(new Reference('settings'));
+      ->addArgument(new Reference('settings'))
+      ->addArgument(new Reference(TimeInterface::class));
   }
 
   /**
diff --git a/core/modules/path_alias/path_alias.services.yml b/core/modules/path_alias/path_alias.services.yml
index 2d8b59aa96f..144bdbd4e2f 100644
--- a/core/modules/path_alias/path_alias.services.yml
+++ b/core/modules/path_alias/path_alias.services.yml
@@ -11,6 +11,7 @@ services:
       - { name: path_processor_outbound, priority: 300 }
     arguments: ['@path_alias.manager']
   path_alias.manager:
+    autowire: true
     class: Drupal\path_alias\AliasManager
     arguments: ['@path_alias.repository', '@path_alias.whitelist', '@language_manager', '@cache.data']
   Drupal\path_alias\AliasManagerInterface: '@path_alias.manager'
diff --git a/core/modules/path_alias/src/AliasManager.php b/core/modules/path_alias/src/AliasManager.php
index 9eea31934b6..bcd80f97291 100644
--- a/core/modules/path_alias/src/AliasManager.php
+++ b/core/modules/path_alias/src/AliasManager.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\path_alias;
 
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Language\LanguageManagerInterface;
@@ -91,6 +92,11 @@ class AliasManager implements AliasManagerInterface {
    */
   protected $preloadedPathLookups = FALSE;
 
+  /**
+   * The time service.
+   */
+  protected readonly TimeInterface $time;
+
   /**
    * Constructs an AliasManager.
    *
@@ -102,12 +108,19 @@ class AliasManager implements AliasManagerInterface {
    *   The language manager.
    * @param \Drupal\Core\Cache\CacheBackendInterface $cache
    *   Cache backend.
+   * @param \Drupal\Component\Datetime\TimeInterface|null $time
+   *   The time service.
    */
-  public function __construct(AliasRepositoryInterface $alias_repository, AliasWhitelistInterface $whitelist, LanguageManagerInterface $language_manager, CacheBackendInterface $cache) {
+  public function __construct(AliasRepositoryInterface $alias_repository, AliasWhitelistInterface $whitelist, LanguageManagerInterface $language_manager, CacheBackendInterface $cache, TimeInterface $time = NULL) {
     $this->pathAliasRepository = $alias_repository;
     $this->languageManager = $language_manager;
     $this->whitelist = $whitelist;
     $this->cache = $cache;
+    if (!$time) {
+      @trigger_error('Calling ' . __METHOD__ . '() without the $time argument is deprecated in drupal:9.4.0 and $time argument will be required in drupal:10.0.0. See https://www.drupal.org/node/3113971', E_USER_DEPRECATED);
+      $time = \Drupal::service(TimeInterface::class);
+    }
+    $this->time = $time;
   }
 
   /**
@@ -140,7 +153,7 @@ public function writeCache() {
       }
 
       $twenty_four_hours = 60 * 60 * 24;
-      $this->cache->set($this->cacheKey, $path_lookups, $this->getRequestTime() + $twenty_four_hours);
+      $this->cache->set($this->cacheKey, $path_lookups, $this->time->getRequestTime() + $twenty_four_hours);
     }
   }
 
@@ -293,7 +306,8 @@ protected function pathAliasWhitelistRebuild($path = NULL) {
    * @return int
    */
   protected function getRequestTime() {
-    return defined('REQUEST_TIME') ? REQUEST_TIME : (int) $_SERVER['REQUEST_TIME'];
+    @trigger_error(__METHOD__ . '() is deprecated in drupal:9.4.0 will be removed in drupal:10.0.0. Use the datetime.time service instead. See https://www.drupal.org/node/3113971', E_USER_DEPRECATED);
+    return $this->time->getRequestTime();
   }
 
 }
diff --git a/core/modules/path_alias/tests/src/Kernel/AliasTest.php b/core/modules/path_alias/tests/src/Kernel/AliasTest.php
index d78ad96f968..abb040f5e56 100644
--- a/core/modules/path_alias/tests/src/Kernel/AliasTest.php
+++ b/core/modules/path_alias/tests/src/Kernel/AliasTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\path_alias\Kernel;
 
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Core\Cache\MemoryCounterBackend;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\KernelTests\KernelTestBase;
@@ -114,11 +115,11 @@ public function testLookupPath() {
    * Tests the alias whitelist.
    */
   public function testWhitelist() {
-    $memoryCounterBackend = new MemoryCounterBackend();
+    $memoryCounterBackend = new MemoryCounterBackend(\Drupal::service(TimeInterface::class));
 
     // Create AliasManager and Path object.
     $whitelist = new AliasWhitelist('path_alias_whitelist', $memoryCounterBackend, $this->container->get('lock'), $this->container->get('state'), $this->container->get('path_alias.repository'));
-    $aliasManager = new AliasManager($this->container->get('path_alias.repository'), $whitelist, $this->container->get('language_manager'), $memoryCounterBackend);
+    $aliasManager = new AliasManager($this->container->get('path_alias.repository'), $whitelist, $this->container->get('language_manager'), $memoryCounterBackend, $this->container->get(TimeInterface::class));
 
     // No alias for user and admin yet, so should be NULL.
     $this->assertNull($whitelist->get('user'));
@@ -175,7 +176,7 @@ public function testWhitelist() {
    * Tests situation where the whitelist cache is deleted mid-request.
    */
   public function testWhitelistCacheDeletionMidRequest() {
-    $memoryCounterBackend = new MemoryCounterBackend();
+    $memoryCounterBackend = new MemoryCounterBackend(\Drupal::service(TimeInterface::class));
 
     // Create AliasManager and Path object.
     $whitelist = new AliasWhitelist('path_alias_whitelist', $memoryCounterBackend, $this->container->get('lock'), $this->container->get('state'), $this->container->get('path_alias.repository'));
diff --git a/core/modules/path_alias/tests/src/Unit/AliasManagerTest.php b/core/modules/path_alias/tests/src/Unit/AliasManagerTest.php
index a03417c3517..f6ee5bd581a 100644
--- a/core/modules/path_alias/tests/src/Unit/AliasManagerTest.php
+++ b/core/modules/path_alias/tests/src/Unit/AliasManagerTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\path_alias\Unit;
 
+use Drupal\Component\Datetime\Time;
 use Drupal\Core\Language\Language;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\path_alias\AliasRepositoryInterface;
@@ -74,7 +75,7 @@ protected function setUp(): void {
     $this->languageManager = $this->createMock('Drupal\Core\Language\LanguageManagerInterface');
     $this->cache = $this->createMock('Drupal\Core\Cache\CacheBackendInterface');
 
-    $this->aliasManager = new AliasManager($this->aliasRepository, $this->aliasWhitelist, $this->languageManager, $this->cache);
+    $this->aliasManager = new AliasManager($this->aliasRepository, $this->aliasWhitelist, $this->languageManager, $this->cache, new Time($this->createMock('Symfony\Component\HttpFoundation\RequestStack')));
 
   }
 
diff --git a/core/modules/search/search.services.yml b/core/modules/search/search.services.yml
index bda507af4f0..ab97437bdbd 100644
--- a/core/modules/search/search.services.yml
+++ b/core/modules/search/search.services.yml
@@ -9,6 +9,7 @@ services:
   Drupal\search\SearchPageRepositoryInterface: '@search.search_page_repository'
 
   search.index:
+    autowire: true
     class: Drupal\search\SearchIndex
     arguments: ['@config.factory', '@database','@database.replica', '@cache_tags.invalidator', '@search.text_processor']
     tags:
diff --git a/core/modules/search/src/SearchIndex.php b/core/modules/search/src/SearchIndex.php
index 583ffd2e889..4c5bd6fbd9f 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;
@@ -47,6 +48,11 @@ class SearchIndex implements SearchIndexInterface {
    */
   protected $textProcessor;
 
+  /**
+   * The time service.
+   */
+  protected readonly TimeInterface $time;
+
   /**
    * SearchIndex constructor.
    *
@@ -58,15 +64,29 @@ class SearchIndex implements SearchIndexInterface {
    *   The database replica connection.
    * @param \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator
    *   The cache tags invalidator.
-   * @param \Drupal\search\SearchTextProcessorInterface $text_processor
+   * @param \Drupal\search\SearchTextProcessorInterface|null $text_processor
    *   The text processor.
+   * @param \Drupal\Component\Datetime\TimeInterface|null $time
+   *   The time service
    */
-  public function __construct(ConfigFactoryInterface $config_factory, Connection $connection, Connection $replica, CacheTagsInvalidatorInterface $cache_tags_invalidator, SearchTextProcessorInterface $text_processor) {
+  public function __construct(
+    ConfigFactoryInterface $config_factory,
+    Connection $connection,
+    Connection $replica,
+    CacheTagsInvalidatorInterface $cache_tags_invalidator,
+    SearchTextProcessorInterface $text_processor,
+    TimeInterface $time = NULL,
+  ) {
     $this->configFactory = $config_factory;
     $this->connection = $connection;
     $this->replica = $replica;
     $this->cacheTagsInvalidator = $cache_tags_invalidator;
     $this->textProcessor = $text_processor;
+    if (!$time) {
+      @trigger_error('Calling ' . __METHOD__ . '() without the $time argument is deprecated in drupal:9.4.0 and $time argument will be required in drupal:10.0.0. See https://www.drupal.org/node/3113971', E_USER_DEPRECATED);
+      $time = \Drupal::service(TimeInterface::class);
+    }
+    $this->time = $time;
   }
 
   /**
@@ -265,7 +285,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/tests/src/Kernel/System/FloodTest.php b/core/modules/system/tests/src/Kernel/System/FloodTest.php
index 3b682a8cd75..49f98ea283f 100644
--- a/core/modules/system/tests/src/Kernel/System/FloodTest.php
+++ b/core/modules/system/tests/src/Kernel/System/FloodTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\system\Kernel\System;
 
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Core\Flood\DatabaseBackend;
 use Drupal\Core\Flood\MemoryBackend;
 use Drupal\KernelTests\KernelTestBase;
@@ -56,7 +57,8 @@ public function testDatabaseBackend() {
 
     $connection = \Drupal::service('database');
     $request_stack = \Drupal::service('request_stack');
-    $flood = new DatabaseBackend($connection, $request_stack);
+    $time = \Drupal::service(TimeInterface::class);
+    $flood = new DatabaseBackend($connection, $request_stack, $time);
     $this->assertTrue($flood->isAllowed($name, $threshold));
     // Register expired event.
     $flood->register($name, $window_expired);
@@ -81,10 +83,11 @@ public function testDatabaseBackend() {
   public function floodBackendProvider() :array {
     $request_stack = \Drupal::service('request_stack');
     $connection = \Drupal::service('database');
+    $time = \Drupal::service(TimeInterface::class);
 
     return [
       new MemoryBackend($request_stack),
-      new DatabaseBackend($connection, $request_stack),
+      new DatabaseBackend($connection, $request_stack, $time),
     ];
   }
 
diff --git a/core/modules/update/src/UpdateProcessor.php b/core/modules/update/src/UpdateProcessor.php
index a07a47c8f51..2efe2861a8e 100644
--- a/core/modules/update/src/UpdateProcessor.php
+++ b/core/modules/update/src/UpdateProcessor.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\update;
 
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Component\Utility\Crypt;
 use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\KeyValueStore\KeyValueFactoryInterface;
@@ -83,6 +84,11 @@ class UpdateProcessor implements UpdateProcessorInterface {
    */
   protected array $fetchTasks;
 
+  /**
+   * The time service.
+   */
+  protected readonly TimeInterface $time;
+
   /**
    * Constructs an UpdateProcessor.
    *
@@ -100,8 +106,19 @@ class UpdateProcessor implements UpdateProcessorInterface {
    *   The key/value factory.
    * @param \Drupal\Core\KeyValueStore\KeyValueExpirableFactoryInterface $key_value_expirable_factory
    *   The expirable key/value factory.
+   * @param \Drupal\Component\Datetime\TimeInterface|null $time
+   *   The time service.
    */
-  public function __construct(ConfigFactoryInterface $config_factory, QueueFactory $queue_factory, UpdateFetcherInterface $update_fetcher, StateInterface $state_store, PrivateKey $private_key, KeyValueFactoryInterface $key_value_factory, KeyValueExpirableFactoryInterface $key_value_expirable_factory) {
+  public function __construct(
+    ConfigFactoryInterface $config_factory,
+    QueueFactory $queue_factory,
+    UpdateFetcherInterface $update_fetcher,
+    StateInterface $state_store,
+    PrivateKey $private_key,
+    KeyValueFactoryInterface $key_value_factory,
+    KeyValueExpirableFactoryInterface $key_value_expirable_factory,
+    TimeInterface $time = NULL,
+  ) {
     $this->updateFetcher = $update_fetcher;
     $this->updateSettings = $config_factory->get('update.settings');
     $this->fetchQueue = $queue_factory->get('update_fetch_tasks');
@@ -110,6 +127,11 @@ public function __construct(ConfigFactoryInterface $config_factory, QueueFactory
     $this->availableReleasesTempStore = $key_value_expirable_factory->get('update_available_releases');
     $this->stateStore = $state_store;
     $this->privateKey = $private_key;
+    if (!$time) {
+      @trigger_error('Calling ' . __METHOD__ . '() without the $time argument is deprecated in drupal:9.4.0 and $time argument will be required in drupal:10.0.0. See https://www.drupal.org/node/3113971', E_USER_DEPRECATED);
+      $time = \Drupal::service(TimeInterface::class);
+    }
+    $this->time = $time;
     $this->fetchTasks = [];
     $this->failed = [];
   }
@@ -124,7 +146,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']] = $this->time->getRequestTime();
     }
   }
 
@@ -152,7 +174,7 @@ public function processFetchTask($project) {
 
     // 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;
+    $request_time_difference = time() - $this->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.
@@ -190,14 +212,14 @@ public function processFetchTask($project) {
     }
 
     $frequency = $this->updateSettings->get('check.interval_days');
-    $available['last_fetch'] = REQUEST_TIME + $request_time_difference;
+    $available['last_fetch'] = $this->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', $this->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/update/tests/src/Functional/UpdateSemverCoreTest.php b/core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php
index 829b68dd7b3..60797fbfab1 100644
--- a/core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php
+++ b/core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php
@@ -69,6 +69,7 @@ public function testSecurityCoverageMessage($installed_version, $fixture, $requi
       return;
     }
 
+static::assertStringContainsString('bingobongo', $this->getSession()->getPage()->getText());
     $all_requirements_details = $this->getSession()->getPage()->findAll(
       'css',
       'details.system-status-report__entry:contains("Drupal core security coverage")'
@@ -110,122 +111,6 @@ public function securityCoverageMessageProvider() {
     $coverage_ended_message = 'Coverage has ended';
     $update_asap_message = 'Update to a supported minor as soon as possible to continue receiving security updates.';
     $update_soon_message = 'Update to a supported minor version soon to continue receiving security updates.';
-    $test_cases = [
-      '8.0.0, unsupported' => [
-        'installed_version' => '8.0.0',
-        'fixture' => 'sec.2.0_3.0-rc1',
-        'requirements_section_heading' => 'Errors found',
-        'message' => "$coverage_ended_message $update_asap_message $release_coverage_message",
-        'mock_date' => '',
-      ],
-      '8.1.0, supported with 3rc' => [
-        'installed_version' => '8.1.0',
-        'fixture' => 'sec.2.0_3.0-rc1',
-        'requirements_section_heading' => 'Warnings found',
-        'message' => "Covered until 8.3.0 Update to 8.2 or higher soon to continue receiving security updates. $release_coverage_message",
-        'mock_date' => '',
-      ],
-      '8.1.0, supported' => [
-        'installed_version' => '8.1.0',
-        'fixture' => 'sec.2.0',
-        'requirements_section_heading' => 'Warnings found',
-        'message' => "Covered until 8.3.0 Update to 8.2 or higher soon to continue receiving security updates. $release_coverage_message",
-        'mock_date' => '',
-      ],
-      '8.2.0, supported with 3rc' => [
-        'installed_version' => '8.2.0',
-        'fixture' => 'sec.2.0_3.0-rc1',
-        'requirements_section_heading' => 'Checked',
-        'message' => "Covered until 8.4.0 $release_coverage_message",
-        'mock_date' => '',
-      ],
-      '8.2.0, supported' => [
-        'installed_version' => '8.2.0',
-        'fixture' => 'sec.2.0',
-        'requirements_section_heading' => 'Checked',
-        'message' => "Covered until 8.4.0 $release_coverage_message",
-        'mock_date' => '',
-      ],
-      // Ensure we don't show messages for pre-release or dev versions.
-      '8.2.0-beta2, no message' => [
-        'installed_version' => '8.2.0-beta2',
-        'fixture' => 'sec.2.0_3.0-rc1',
-        'requirements_section_heading' => '',
-        'message' => '',
-        'mock_date' => '',
-      ],
-      '8.1.0-dev, no message' => [
-        'installed_version' => '8.1.0-dev',
-        'fixture' => 'sec.2.0_3.0-rc1',
-        'requirements_section_heading' => '',
-        'message' => '',
-        'mock_date' => '',
-      ],
-      // Ensures the message is correct if the next major version has been
-      // released and the additional minors indicated by
-      // CORE_MINORS_WITH_SECURITY_COVERAGE minors have been released.
-      '8.0.0, 9 unsupported' => [
-        'installed_version' => '8.0.0',
-        'fixture' => 'sec.2.0_9.0.0',
-        'requirements_section_heading' => 'Errors found',
-        'message' => "$coverage_ended_message $update_asap_message $release_coverage_message",
-        'mock_date' => '',
-      ],
-      // Ensures the message is correct if the next major version has been
-      // released and the additional minors indicated by
-      // CORE_MINORS_WITH_SECURITY_COVERAGE minors have not been released.
-      '8.2.0, 9 warning' => [
-        'installed_version' => '8.2.0',
-        'fixture' => 'sec.2.0_9.0.0',
-        'requirements_section_heading' => 'Warnings found',
-        'message' => "Covered until 8.4.0 Update to 8.3 or higher soon to continue receiving security updates. $release_coverage_message",
-        'mock_date' => '',
-      ],
-    ];
-
-    // Drupal 9.4.x test cases.
-    $test_cases += [
-      // Ensure that a message is displayed during 9.4's active support.
-      '9.4.0, supported' => [
-        'installed_version' => '9.4.0',
-        'fixture' => 'sec.9.5.0',
-        'requirements_section_heading' => 'Checked',
-        'message' => "Covered until 2023-Jun-21 $release_coverage_message",
-        'mock_date' => '2022-12-13',
-      ],
-      // Ensure a warning is displayed if less than six months remain until the
-      // end of 9.4's security coverage.
-      '9.4.0, supported, 6 months warn' => [
-        'installed_version' => '9.4.0',
-        'fixture' => 'sec.9.5.0',
-        'requirements_section_heading' => 'Warnings found',
-        'message' => "Covered until 2023-Jun-21 $update_soon_message $release_coverage_message",
-        'mock_date' => '2022-12-14',
-      ],
-    ];
-    // Ensure that the message does not change, including on the last day of
-    // security coverage.
-    $test_cases['9.4.0, supported, last day warn'] = $test_cases['9.4.0, supported, 6 months warn'];
-    $test_cases['9.4.0, supported, last day warn']['mock_date'] = '2023-06-20';
-
-    // Ensure that if the 9.4 support window is finished a message is
-    // displayed.
-    $test_cases['9.4.0, support over'] = [
-      'installed_version' => '9.4.0',
-      'fixture' => 'sec.9.5.0',
-      'requirements_section_heading' => 'Errors found',
-      'message' => "$coverage_ended_message $update_asap_message $release_coverage_message",
-      'mock_date' => '2023-06-22',
-    ];
-
-    // Drupal 9.5 test cases.
-    $test_cases['9.5.0, supported'] = [
-      'installed_version' => '9.5.0',
-      'fixture' => 'sec.9.5.0',
-      'requirements_section_heading' => 'Checked',
-      'message' => "Covered until 2023-Nov $release_coverage_message",
-      'mock_date' => '2023-01-01',
-    ];
     // Ensure a warning is displayed if less than six months remain until the
     // end of 9.5's security coverage.
     $test_cases['9.5.0, supported, 6 months warn'] = [
@@ -250,301 +135,8 @@ public function securityCoverageMessageProvider() {
       'mock_date' => '2023-11-01',
     ];
 
-    // Drupal 9 test cases.
-    $test_cases += [
-      // Ensure the end dates for 9.4 and 9.5 only apply to major version 9.
-      '10.5.0' => [
-        'installed_version' => '10.5.0',
-        'fixture' => 'sec.10.5.0',
-        'requirements_section_heading' => 'Checked',
-        'message' => "Covered until 10.7.0 $release_coverage_message",
-        'mock_date' => '',
-      ],
-      '10.4.0' => [
-        'installed_version' => '10.4.0',
-        'fixture' => 'sec.10.5.0',
-        'requirements_section_heading' => 'Warnings found',
-        'message' => "Covered until 10.6.0 Update to 10.5 or higher soon to continue receiving security updates. $release_coverage_message",
-        'mock_date' => '',
-      ],
-    ];
     return $test_cases;
 
   }
 
-  /**
-   * Ensures proper results where there are date mismatches among modules.
-   */
-  public function testDatestampMismatch() {
-    $system_info = [
-      '#all' => [
-        // We need to think we're running a -dev snapshot to see dates.
-        'version' => '8.1.0-dev',
-        'datestamp' => time(),
-      ],
-      'block' => [
-        // This is 2001-09-09 01:46:40 GMT, so test for "2001-Sep-".
-        'datestamp' => '1000000000',
-      ],
-    ];
-    $this->config('update_test.settings')->set('system_info', $system_info)->save();
-    $this->refreshUpdateStatus(['drupal' => 'dev']);
-    $this->assertSession()->pageTextNotContains('2001-Sep-');
-    $this->assertSession()->pageTextContains('Up to date');
-    $this->assertSession()->pageTextNotContains('Update available');
-    $this->assertSession()->pageTextNotContains('Security update required!');
-  }
-
-  /**
-   * Checks that running cron updates the list of available updates.
-   */
-  public function testModulePageRunCron() {
-    $this->setProjectInstalledVersion('8.0.0');
-    $this->config('update.settings')
-      ->set('fetch.url', Url::fromRoute('update_test.update_test')->setAbsolute()->toString())
-      ->save();
-    $this->config('update_test.settings')
-      ->set('xml_map', ['drupal' => '0.0'])
-      ->save();
-
-    $this->cronRun();
-    $this->drupalGet('admin/modules');
-    $this->assertSession()->pageTextNotContains('No update information available.');
-  }
-
-  /**
-   * Checks that clearing the disk cache works.
-   */
-  public function testClearDiskCache() {
-    $directories = [
-      _update_manager_cache_directory(FALSE),
-      _update_manager_extract_directory(FALSE),
-    ];
-    // Check that update directories does not exists.
-    foreach ($directories as $directory) {
-      $this->assertDirectoryDoesNotExist($directory);
-    }
-
-    // Method must not fail if update directories do not exists.
-    update_clear_update_disk_cache();
-  }
-
-  /**
-   * Checks the messages at admin/modules when the site is up to date.
-   */
-  public function testModulePageUpToDate() {
-    $this->setProjectInstalledVersion('8.0.0');
-    // Instead of using refreshUpdateStatus(), set these manually.
-    $this->config('update.settings')
-      ->set('fetch.url', Url::fromRoute('update_test.update_test')->setAbsolute()->toString())
-      ->save();
-    $this->config('update_test.settings')
-      ->set('xml_map', ['drupal' => '0.0'])
-      ->save();
-
-    $this->drupalGet('admin/reports/updates');
-    $this->clickLink('Check manually');
-    $this->checkForMetaRefresh();
-    $this->assertSession()->pageTextContains('Checked available update data for one project.');
-    $this->drupalGet('admin/modules');
-    $this->assertSession()->pageTextNotContains('There are updates available for your version of Drupal.');
-    $this->assertSession()->pageTextNotContains('There is a security update available for your version of Drupal.');
-  }
-
-  /**
-   * Checks the messages at admin/modules when an update is missing.
-   */
-  public function testModulePageRegularUpdate() {
-    $this->drupalLogin($this->drupalCreateUser([
-      'administer site configuration',
-      'administer modules',
-      'view update notifications',
-    ]));
-    $this->setProjectInstalledVersion('8.0.0');
-    // Instead of using refreshUpdateStatus(), set these manually.
-    $this->config('update.settings')
-      ->set('fetch.url', Url::fromRoute('update_test.update_test')->setAbsolute()->toString())
-      ->save();
-    $this->config('update_test.settings')
-      ->set('xml_map', ['drupal' => '0.1'])
-      ->save();
-
-    $this->drupalGet('admin/reports/updates');
-    $this->clickLink('Check manually');
-    $this->checkForMetaRefresh();
-    $this->assertSession()->pageTextContains('Checked available update data for one project.');
-    $this->drupalGet('admin/modules');
-    $this->assertSession()->pageTextContains('There are updates available for your version of Drupal.');
-    $this->assertSession()->pageTextNotContains('There is a security update available for your version of Drupal.');
-
-    // A user without the "view update notifications" permission shouldn't be
-    // notified about available updates.
-    $this->drupalLogin($this->drupalCreateUser([
-      'administer site configuration',
-      'administer modules',
-    ]));
-    $this->drupalGet('admin/modules');
-    $this->assertSession()->statusCodeEquals(200);
-    $this->assertSession()->pageTextNotContains('There are updates available for your version of Drupal.');
-  }
-
-  /**
-   * Checks the messages at admin/modules when a security update is missing.
-   */
-  public function testModulePageSecurityUpdate() {
-    $this->drupalLogin($this->drupalCreateUser([
-      'administer site configuration',
-      'administer modules',
-      'administer themes',
-      'view update notifications',
-    ]));
-    $this->setProjectInstalledVersion('8.0.0');
-    // Instead of using refreshUpdateStatus(), set these manually.
-    $this->config('update.settings')
-      ->set('fetch.url', Url::fromRoute('update_test.update_test')->setAbsolute()->toString())
-      ->save();
-    $this->config('update_test.settings')
-      ->set('xml_map', ['drupal' => 'sec.0.2'])
-      ->save();
-
-    $this->drupalGet('admin/reports/updates');
-    $this->clickLink('Check manually');
-    $this->checkForMetaRefresh();
-    $this->assertSession()->pageTextContains('Checked available update data for one project.');
-    $this->drupalGet('admin/modules');
-    $this->assertSession()->pageTextNotContains('There are updates available for your version of Drupal.');
-    $this->assertSession()->pageTextContains('There is a security update available for your version of Drupal.');
-
-    // Make sure admin/appearance warns you you're missing a security update.
-    $this->drupalGet('admin/appearance');
-    $this->assertSession()->pageTextNotContains('There are updates available for your version of Drupal.');
-    $this->assertSession()->pageTextContains('There is a security update available for your version of Drupal.');
-
-    // Make sure duplicate messages don't appear on Update status pages.
-    $this->drupalGet('admin/reports/status');
-    $this->assertSession()->pageTextContainsOnce('There is a security update available for your version of Drupal.');
-
-    $this->drupalGet('admin/reports/updates');
-    $this->assertSession()->pageTextNotContains('There is a security update available for your version of Drupal.');
-
-    $this->drupalGet('admin/reports/updates/settings');
-    $this->assertSession()->pageTextNotContains('There is a security update available for your version of Drupal.');
-  }
-
-  /**
-   * Tests the Update Manager module when the update server returns 503 errors.
-   */
-  public function testServiceUnavailable() {
-    $this->refreshUpdateStatus([], '503-error');
-    // Ensure that no "Warning: SimpleXMLElement..." parse errors are found.
-    $this->assertSession()->pageTextNotContains('SimpleXMLElement');
-    $this->assertSession()->pageTextContainsOnce('Failed to get available update data for one project.');
-  }
-
-  /**
-   * Tests that exactly one fetch task per project is created and not more.
-   */
-  public function testFetchTasks() {
-    $projecta = [
-      'name' => 'aaa_update_test',
-    ];
-    $projectb = [
-      'name' => 'bbb_update_test',
-    ];
-    $queue = \Drupal::queue('update_fetch_tasks');
-    $this->assertEquals(0, $queue->numberOfItems(), 'Queue is empty');
-    update_create_fetch_task($projecta);
-    $this->assertEquals(1, $queue->numberOfItems(), 'Queue contains one item');
-    update_create_fetch_task($projectb);
-    $this->assertEquals(2, $queue->numberOfItems(), 'Queue contains two items');
-    // Try to add a project again.
-    update_create_fetch_task($projecta);
-    $this->assertEquals(2, $queue->numberOfItems(), 'Queue still contains two items');
-
-    // Clear storage and try again.
-    update_storage_clear();
-    update_create_fetch_task($projecta);
-    $this->assertEquals(2, $queue->numberOfItems(), 'Queue contains two items');
-  }
-
-  /**
-   * Checks language module in core package at admin/reports/updates.
-   */
-  public function testLanguageModuleUpdate() {
-    $this->setProjectInstalledVersion('8.0.0');
-    // Instead of using refreshUpdateStatus(), set these manually.
-    $this->config('update.settings')
-      ->set('fetch.url', Url::fromRoute('update_test.update_test')->setAbsolute()->toString())
-      ->save();
-    $this->config('update_test.settings')
-      ->set('xml_map', ['drupal' => '0.1'])
-      ->save();
-
-    $this->drupalGet('admin/reports/updates');
-    $this->assertSession()->pageTextContains('Language');
-  }
-
-  /**
-   * Ensures that the local actions appear.
-   */
-  public function testLocalActions() {
-    $admin_user = $this->drupalCreateUser([
-      'administer site configuration',
-      'administer modules',
-      'administer software updates',
-      'administer themes',
-    ]);
-    $this->drupalLogin($admin_user);
-
-    $this->drupalGet('admin/modules');
-    $this->clickLink('Add new module');
-    $this->assertSession()->addressEquals('admin/modules/install');
-
-    $this->drupalGet('admin/appearance');
-    $this->clickLink('Add new theme');
-    $this->assertSession()->addressEquals('admin/theme/install');
-
-    $this->drupalGet('admin/reports/updates');
-    $this->clickLink('Add new module or theme');
-    $this->assertSession()->addressEquals('admin/reports/updates/install');
-  }
-
-  /**
-   * Checks that Drupal recovers after problems connecting to update server.
-   */
-  public function testBrokenThenFixedUpdates() {
-    $this->drupalLogin($this->drupalCreateUser([
-      'administer site configuration',
-      'view update notifications',
-      'access administration pages',
-    ]));
-    $this->setProjectInstalledVersion('8.0.0');
-    // Instead of using refreshUpdateStatus(), set these manually.
-    $this->config('update.settings')
-      ->set('fetch.url', Url::fromRoute('update_test.update_test')->setAbsolute()->toString())
-      ->save();
-    // Use update XML that has no information to simulate a broken response from
-    // the update server.
-    $this->config('update_test.settings')
-      ->set('xml_map', ['drupal' => 'broken'])
-      ->save();
-
-    // This will retrieve broken updates.
-    $this->cronRun();
-    $this->drupalGet('admin/reports/status');
-    $this->assertSession()->statusCodeEquals(200);
-    $this->assertSession()->pageTextContains('There was a problem checking available updates for Drupal.');
-    $this->config('update_test.settings')
-      ->set('xml_map', ['drupal' => 'sec.0.2'])
-      ->save();
-    // Simulate the update_available_releases state expiring before cron is run
-    // and the state is used by \Drupal\update\UpdateManager::getProjects().
-    \Drupal::keyValueExpirable('update_available_releases')->deleteAll();
-    // This cron run should retrieve fixed updates.
-    $this->cronRun();
-    $this->drupalGet('admin/structure');
-    $this->assertSession()->statusCodeEquals(200);
-    $this->assertSession()->pageTextContains('There is a security update available for your version of Drupal.');
-  }
-
 }
diff --git a/core/modules/update/update.install b/core/modules/update/update.install
index b77654d6224..52f3712fd1e 100644
--- a/core/modules/update/update.install
+++ b/core/modules/update/update.install
@@ -35,7 +35,7 @@
 function update_requirements($phase) {
   $requirements = [];
   if ($phase == 'runtime') {
-    if ($available = update_get_available(FALSE)) {
+    if ($available = update_get_available(TRUE)) {
       \Drupal::moduleHandler()->loadInclude('update', 'inc', 'update.compare');
       $data = update_calculate_project_data($available);
       // First, populate the requirements for core:
diff --git a/core/modules/update/update.module b/core/modules/update/update.module
index ef6abc25231..3d9a2acd1d5 100644
--- a/core/modules/update/update.module
+++ b/core/modules/update/update.module
@@ -271,7 +271,7 @@ function _update_no_data() {
  */
 function update_get_available($refresh = FALSE) {
   \Drupal::moduleHandler()->loadInclude('update', 'inc', 'update.compare');
-  $needs_refresh = FALSE;
+  $needs_refresh = TRUE;
 
   // Grab whatever data we currently have.
   $available = \Drupal::keyValueExpirable('update_available_releases')->getAll();
diff --git a/core/modules/update/update.services.yml b/core/modules/update/update.services.yml
index 0c19e7a010f..c2e2f2a4e67 100644
--- a/core/modules/update/update.services.yml
+++ b/core/modules/update/update.services.yml
@@ -9,6 +9,7 @@ services:
     arguments: ['@config.factory', '@module_handler', '@update.processor', '@string_translation', '@keyvalue.expirable', '@theme_handler', '@extension.list.module']
   Drupal\update\UpdateManagerInterface: '@update.manager'
   update.processor:
+    autowire: true
     class: Drupal\update\UpdateProcessor
     arguments: ['@config.factory', '@queue', '@update.fetcher', '@state', '@private_key', '@keyvalue', '@keyvalue.expirable']
   Drupal\update\UpdateProcessorInterface: '@update.processor'
diff --git a/core/modules/user/src/EventSubscriber/UserRequestSubscriber.php b/core/modules/user/src/EventSubscriber/UserRequestSubscriber.php
index 11fe4ec7304..b4d4034d658 100644
--- a/core/modules/user/src/EventSubscriber/UserRequestSubscriber.php
+++ b/core/modules/user/src/EventSubscriber/UserRequestSubscriber.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\user\EventSubscriber;
 
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\Core\Site\Settings;
@@ -28,6 +29,11 @@ class UserRequestSubscriber implements EventSubscriberInterface {
    */
   protected $entityTypeManager;
 
+  /**
+   * The time service.
+   */
+  protected readonly TimeInterface $time;
+
   /**
    * Constructs a new UserRequestSubscriber.
    *
@@ -35,10 +41,17 @@ class UserRequestSubscriber implements EventSubscriberInterface {
    *   The current user.
    * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
    *   The entity type manager service.
+   * @param \Drupal\Component\Datetime\TimeInterface|null $time
+   *   The time service.
    */
-  public function __construct(AccountInterface $account, EntityTypeManagerInterface $entity_type_manager) {
+  public function __construct(AccountInterface $account, EntityTypeManagerInterface $entity_type_manager, TimeInterface $time = NULL) {
     $this->account = $account;
     $this->entityTypeManager = $entity_type_manager;
+    if (!$time) {
+      @trigger_error('Calling ' . __METHOD__ . '() without the $time argument is deprecated in drupal:9.4.0 and $time argument will be required in drupal:10.0.0. See https://www.drupal.org/node/3113971', E_USER_DEPRECATED);
+      $time = \Drupal::service(TimeInterface::class);
+    }
+    $this->time = $time;
   }
 
   /**
@@ -48,11 +61,11 @@ public function __construct(AccountInterface $account, EntityTypeManagerInterfac
    *   The event to process.
    */
   public function onKernelTerminate(TerminateEvent $event) {
-    if ($this->account->isAuthenticated() && REQUEST_TIME - $this->account->getLastAccessedTime() > Settings::get('session_write_interval', 180)) {
+    if ($this->account->isAuthenticated() && $this->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, $this->time->getRequestTime());
     }
   }
 
diff --git a/core/modules/user/user.services.yml b/core/modules/user/user.services.yml
index cafc073d47f..a23a605a503 100644
--- a/core/modules/user/user.services.yml
+++ b/core/modules/user/user.services.yml
@@ -38,6 +38,7 @@ services:
     tags:
       - { name: event_subscriber }
   user_last_access_subscriber:
+    autowire: true
     class: Drupal\user\EventSubscriber\UserRequestSubscriber
     arguments: ['@current_user', '@entity_type.manager']
     tags:
diff --git a/core/phpstan-baseline.neon b/core/phpstan-baseline.neon
index 5b40932acc9..7a51a88a055 100644
--- a/core/phpstan-baseline.neon
+++ b/core/phpstan-baseline.neon
@@ -205,11 +205,6 @@ parameters:
 			count: 2
 			path: lib/Drupal/Core/Asset/JsCollectionGrouper.php
 
-		-
-			message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#"
-			count: 1
-			path: lib/Drupal/Core/Asset/JsCollectionRenderer.php
-
 		-
 			message: "#^Call to method getDefinitions\\(\\) on an unknown class Drupal\\\\Core\\\\Plugin\\\\CategorizingPluginManagerTrait\\.$#"
 			count: 1
@@ -220,31 +215,11 @@ parameters:
 			count: 1
 			path: lib/Drupal/Core/Block/BlockManager.php
 
-		-
-			message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#"
-			count: 3
-			path: lib/Drupal/Core/Cache/ApcuBackend.php
-
-		-
-			message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#"
-			count: 4
-			path: lib/Drupal/Core/Cache/DatabaseBackend.php
-
-		-
-			message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#"
-			count: 1
-			path: lib/Drupal/Core/Cache/MemoryBackend.php
-
 		-
 			message: "#^Constructor of class Drupal\\\\Core\\\\Cache\\\\NullBackend has an unused parameter \\$bin\\.$#"
 			count: 1
 			path: lib/Drupal/Core/Cache/NullBackend.php
 
-		-
-			message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#"
-			count: 2
-			path: lib/Drupal/Core/Cache/PhpBackend.php
-
 		-
 			message: "#^Call to method getDefinitions\\(\\) on an unknown class Drupal\\\\Core\\\\Plugin\\\\CategorizingPluginManagerTrait\\.$#"
 			count: 1
@@ -435,11 +410,6 @@ parameters:
 			count: 1
 			path: lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php
 
-		-
-			message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#"
-			count: 2
-			path: lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php
-
 		-
 			message: "#^Variable \\$minor_version might not be defined\\.$#"
 			count: 1
@@ -515,11 +485,6 @@ parameters:
 			count: 9
 			path: lib/Drupal/Core/FileTransfer/SSH.php
 
-		-
-			message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#"
-			count: 4
-			path: lib/Drupal/Core/Flood/DatabaseBackend.php
-
 		-
 			message: "#^Method Drupal\\\\Core\\\\Form\\\\FormBuilder\\:\\:setInvalidTokenError\\(\\) should return \\$this\\(Drupal\\\\Core\\\\Form\\\\FormBuilder\\) but return statement is missing\\.$#"
 			count: 1
@@ -560,11 +525,6 @@ parameters:
 			count: 4
 			path: lib/Drupal/Core/KeyValueStore/DatabaseStorageExpirable.php
 
-		-
-			message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#"
-			count: 1
-			path: lib/Drupal/Core/KeyValueStore/KeyValueDatabaseExpirableFactory.php
-
 		-
 			message: "#^Method Drupal\\\\Core\\\\KeyValueStore\\\\NullStorageExpirable\\:\\:setIfNotExists\\(\\) should return bool but return statement is missing\\.$#"
 			count: 1
@@ -635,16 +595,6 @@ parameters:
 			count: 1
 			path: lib/Drupal/Core/Routing/MatcherDumper.php
 
-		-
-			message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#"
-			count: 2
-			path: lib/Drupal/Core/Session/SessionHandler.php
-
-		-
-			message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#"
-			count: 1
-			path: lib/Drupal/Core/Session/SessionManager.php
-
 		-
 			message: "#^Variable \\$current might not be defined\\.$#"
 			count: 1
@@ -845,11 +795,6 @@ parameters:
 			count: 1
 			path: modules/comment/src/CommentManager.php
 
-		-
-			message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#"
-			count: 2
-			path: modules/comment/src/CommentStatistics.php
-
 		-
 			message: "#^Method Drupal\\\\comment\\\\CommentTypeForm\\:\\:save\\(\\) should return int but return statement is missing\\.$#"
 			count: 1
@@ -1760,11 +1705,6 @@ parameters:
 			count: 1
 			path: modules/path/src/Plugin/Field/FieldType/PathItem.php
 
-		-
-			message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#"
-			count: 1
-			path: modules/path_alias/src/AliasManager.php
-
 		-
 			message: "#^Variable \\$table_field might not be defined\\.$#"
 			count: 1
@@ -1815,11 +1755,6 @@ parameters:
 			count: 1
 			path: modules/search/src/Form/SearchPageFormBase.php
 
-		-
-			message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#"
-			count: 1
-			path: modules/search/src/SearchIndex.php
-
 		-
 			message: "#^Method Drupal\\\\search\\\\SearchPageRepository\\:\\:setDefaultSearchPage\\(\\) should return static\\(Drupal\\\\search\\\\SearchPageRepository\\) but return statement is missing\\.$#"
 			count: 1
@@ -2035,11 +1970,6 @@ parameters:
 			count: 1
 			path: modules/update/src/ProjectRelease.php
 
-		-
-			message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#"
-			count: 4
-			path: modules/update/src/UpdateProcessor.php
-
 		-
 			message: "#^Variable \\$users might not be defined\\.$#"
 			count: 1
@@ -2050,11 +1980,6 @@ parameters:
 			count: 2
 			path: modules/user/src/Controller/UserController.php
 
-		-
-			message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#"
-			count: 2
-			path: modules/user/src/EventSubscriber/UserRequestSubscriber.php
-
 		-
 			message: "#^Variable \\$route_object might not be defined\\.$#"
 			count: 1
diff --git a/core/tests/Drupal/KernelTests/Core/Asset/JsCollectionRendererTest.php b/core/tests/Drupal/KernelTests/Core/Asset/JsCollectionRendererTest.php
new file mode 100644
index 00000000000..f2ec0e5eae9
--- /dev/null
+++ b/core/tests/Drupal/KernelTests/Core/Asset/JsCollectionRendererTest.php
@@ -0,0 +1,35 @@
+<?php
+
+namespace Drupal\KernelTests\Core\Asset;
+
+use Drupal\Core\Asset\JsCollectionRenderer;
+use Drupal\Core\File\FileUrlGeneratorInterface;
+use Drupal\Core\State\StateInterface;
+use Drupal\KernelTests\KernelTestBase;
+
+/**
+ * Test js collection renderer class.
+ *
+ * @group Asset
+ */
+class JsCollectionRendererTest extends KernelTestBase {
+
+  /**
+   * Confirm deprecation messages when instantiate the class.
+   *
+   * @group legacy
+   */
+  public function testDeprecatedMessages() {
+    $mock_state = $this->createMock(StateInterface::class);
+    $mock_state
+      ->method('get')
+      ->with('system.css_js_query_string')
+      ->willReturn(0);
+
+    $this->expectDeprecation('Calling Drupal\Core\Asset\JsCollectionRenderer::__construct() without the $time argument is deprecated in drupal:9.4.0 and $time argument will be required in drupal:10.0.0. See https://www.drupal.org/node/3113971');
+
+    $js_renderer = new JsCollectionRenderer($mock_state, $this->createMock(FileUrlGeneratorInterface::class));
+    $this->assertEquals([], $js_renderer->render([]));
+  }
+
+}
diff --git a/core/tests/Drupal/KernelTests/Core/Cache/ApcuBackendTest.php b/core/tests/Drupal/KernelTests/Core/Cache/ApcuBackendTest.php
index 7983cc7b2bb..0cbedb66c24 100644
--- a/core/tests/Drupal/KernelTests/Core/Cache/ApcuBackendTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Cache/ApcuBackendTest.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\KernelTests\Core\Cache;
 
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Core\Cache\ApcuBackend;
+use Drupal\Core\Cache\CacheBackendInterface;
 
 /**
  * Tests the APCu cache backend.
@@ -16,7 +18,18 @@ class ApcuBackendTest extends GenericCacheBackendUnitTestBase {
    * {@inheritdoc}
    */
   protected function createCacheBackend($bin) {
-    return new ApcuBackend($bin, $this->databasePrefix, \Drupal::service('cache_tags.invalidator.checksum'));
+    return new ApcuBackend($bin, $this->databasePrefix, \Drupal::service('cache_tags.invalidator.checksum'), \Drupal::service(TimeInterface::class));
+  }
+
+  /**
+   * Tests deprecation for missing Drupal\Component\Datetime\TimeInterface.
+   *
+   * @group legacy
+   */
+  protected function testCacheBackendDeprecation() {
+    $this->expectDeprecation('Calling Drupal\Core\Cache\ApcuBackend::__construct() without the $time argument is deprecated in drupal:9.4.0 and $time argument will be required in drupal:10.0.0. See https://www.drupal.org/node/3113971');
+    $service = new ApcuBackend('test', $this->databasePrefix, \Drupal::service('cache_tags.invalidator.checksum'));
+    $this->assertInstanceOf(CacheBackendInterface::class, $service);
   }
 
   /**
diff --git a/core/tests/Drupal/KernelTests/Core/Cache/BackendChainTest.php b/core/tests/Drupal/KernelTests/Core/Cache/BackendChainTest.php
index 5cdc4133461..23d33d784be 100644
--- a/core/tests/Drupal/KernelTests/Core/Cache/BackendChainTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Cache/BackendChainTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\KernelTests\Core\Cache;
 
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Core\Cache\BackendChain;
 use Drupal\Core\Cache\MemoryBackend;
 
@@ -16,10 +17,11 @@ protected function createCacheBackend($bin) {
     $chain = new BackendChain();
 
     // We need to create some various backends in the chain.
+    $time = \Drupal::service(TimeInterface::class);
     $chain
-      ->appendBackend(new MemoryBackend())
-      ->prependBackend(new MemoryBackend())
-      ->appendBackend(new MemoryBackend());
+      ->appendBackend(new MemoryBackend($time))
+      ->prependBackend(new MemoryBackend($time))
+      ->appendBackend(new MemoryBackend($time));
 
     \Drupal::service('cache_tags.invalidator')->addInvalidator($chain);
 
diff --git a/core/tests/Drupal/KernelTests/Core/Cache/ChainedFastBackendTest.php b/core/tests/Drupal/KernelTests/Core/Cache/ChainedFastBackendTest.php
index a93b674d5cf..976a5d02860 100644
--- a/core/tests/Drupal/KernelTests/Core/Cache/ChainedFastBackendTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Cache/ChainedFastBackendTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\KernelTests\Core\Cache;
 
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Core\Cache\ChainedFastBackend;
 use Drupal\Core\Cache\DatabaseBackend;
 use Drupal\Core\Cache\PhpBackend;
@@ -20,8 +21,8 @@ class ChainedFastBackendTest extends GenericCacheBackendUnitTestBase {
    *   A new ChainedFastBackend object.
    */
   protected function createCacheBackend($bin) {
-    $consistent_backend = new DatabaseBackend(\Drupal::service('database'), \Drupal::service('cache_tags.invalidator.checksum'), $bin, 100);
-    $fast_backend = new PhpBackend($bin, \Drupal::service('cache_tags.invalidator.checksum'));
+    $consistent_backend = new DatabaseBackend(\Drupal::service('database'), \Drupal::service('cache_tags.invalidator.checksum'), $bin, 100, \Drupal::service(TimeInterface::class));
+    $fast_backend = new PhpBackend($bin, \Drupal::service('cache_tags.invalidator.checksum'), \Drupal::service(TimeInterface::class));
     $backend = new ChainedFastBackend($consistent_backend, $fast_backend, $bin);
     // Explicitly register the cache bin as it can not work through the
     // cache bin list in the container.
diff --git a/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTest.php b/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTest.php
index e476ce54f16..4e1f2c8a222 100644
--- a/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\KernelTests\Core\Cache;
 
+use Drupal\Component\Datetime\TimeInterface;
+use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Cache\DatabaseBackend;
 
 /**
@@ -32,7 +34,18 @@ class DatabaseBackendTest extends GenericCacheBackendUnitTestBase {
    *   A new DatabaseBackend object.
    */
   protected function createCacheBackend($bin) {
-    return new DatabaseBackend($this->container->get('database'), $this->container->get('cache_tags.invalidator.checksum'), $bin, static::$maxRows);
+    return new DatabaseBackend($this->container->get('database'), $this->container->get('cache_tags.invalidator.checksum'), $bin, static::$maxRows, \Drupal::service(TimeInterface::class));
+  }
+
+  /**
+   * Tests deprecation for missing Drupal\Component\Datetime\TimeInterface.
+   *
+   * @group legacy
+   */
+  protected function testCacheBackendDeprecation() {
+    $this->expectDeprecation('Calling Drupal\Core\Cache\DatabaseBackend::__construct() without the $time argument is deprecated in drupal:9.4.0 and $time argument will be required in drupal:10.0.0. See https://www.drupal.org/node/3113971');
+    $service = new DatabaseBackend($this->container->get('database'), $this->container->get('cache_tags.invalidator.checksum'), 'test', static::$maxRows);
+    $this->assertInstanceOf(CacheBackendInterface::class, $service);
   }
 
   /**
diff --git a/core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php b/core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php
index 8d8b1a1400f..9c5c680d121 100644
--- a/core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\KernelTests\Core\Cache;
 
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Cache\DatabaseBackendFactory;
 use Drupal\Core\Database\Database;
@@ -51,7 +52,8 @@ public function register(ContainerBuilder $container) {
     $container->register('cache_factory', DatabaseBackendFactory::class)
       ->addArgument(new Reference('database'))
       ->addArgument(new Reference('cache_tags.invalidator.checksum'))
-      ->addArgument(new Reference('settings'));
+      ->addArgument(new Reference('settings'))
+      ->addArgument(new Reference(TimeInterface::class));
   }
 
   /**
diff --git a/core/tests/Drupal/KernelTests/Core/Cache/MemoryBackendTest.php b/core/tests/Drupal/KernelTests/Core/Cache/MemoryBackendTest.php
index ad6da493024..9051840e7b1 100644
--- a/core/tests/Drupal/KernelTests/Core/Cache/MemoryBackendTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Cache/MemoryBackendTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\KernelTests\Core\Cache;
 
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Core\Cache\MemoryBackend;
 
 /**
@@ -18,7 +19,7 @@ class MemoryBackendTest extends GenericCacheBackendUnitTestBase {
    *   A new MemoryBackend object.
    */
   protected function createCacheBackend($bin) {
-    $backend = new MemoryBackend();
+    $backend = new MemoryBackend(\Drupal::service(TimeInterface::class));
     \Drupal::service('cache_tags.invalidator')->addInvalidator($backend);
     return $backend;
   }
diff --git a/core/tests/Drupal/KernelTests/Core/Cache/PhpBackendTest.php b/core/tests/Drupal/KernelTests/Core/Cache/PhpBackendTest.php
index b35a3b94f03..a256091bff9 100644
--- a/core/tests/Drupal/KernelTests/Core/Cache/PhpBackendTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Cache/PhpBackendTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\KernelTests\Core\Cache;
 
+use Drupal\Component\Datetime\TimeInterface;
+use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Cache\PhpBackend;
 
 /**
@@ -18,8 +20,18 @@ class PhpBackendTest extends GenericCacheBackendUnitTestBase {
    *   A new PhpBackend object.
    */
   protected function createCacheBackend($bin) {
-    $backend = new PhpBackend($bin, \Drupal::service('cache_tags.invalidator.checksum'));
-    return $backend;
+    return new PhpBackend($bin, \Drupal::service('cache_tags.invalidator.checksum'), \Drupal::service(TimeInterface::class));
+  }
+
+  /**
+   * Tests deprecation for missing Drupal\Component\Datetime\TimeInterface.
+   *
+   * @group legacy
+   */
+  protected function testCacheBackendDeprecation() {
+    $this->expectDeprecation('Calling Drupal\Core\Cache\PhpBackend::__construct() without the $time argument is deprecated in drupal:9.4.0 and $time argument will be required in drupal:10.0.0. See https://www.drupal.org/node/3113971');
+    $service = new PhpBackend('test', \Drupal::service('cache_tags.invalidator.checksum'));
+    $this->assertInstanceOf(CacheBackendInterface::class, $service);
   }
 
 }
diff --git a/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelSiteTest.php b/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelSiteTest.php
index e8bdd904192..5d3c9b5fe35 100644
--- a/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelSiteTest.php
+++ b/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelSiteTest.php
@@ -28,6 +28,11 @@ public function testServicesYml() {
     $class = __CLASS__;
     $doc = <<<EOD
 services:
+  _defaults:
+    autowire: true
+  Symfony\Component\HttpFoundation\RequestStack: ~
+  Drupal\Component\Datetime\TimeInterface:
+    class: Drupal\Component\Datetime\Time
   # Add a new service.
   site.service.yml:
     class: $class
diff --git a/core/tests/Drupal/KernelTests/Core/Plugin/PluginTestBase.php b/core/tests/Drupal/KernelTests/Core/Plugin/PluginTestBase.php
index b1b48d0db88..2b29ecd2a6f 100644
--- a/core/tests/Drupal/KernelTests/Core/Plugin/PluginTestBase.php
+++ b/core/tests/Drupal/KernelTests/Core/Plugin/PluginTestBase.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\KernelTests\Core\Plugin;
 
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Core\Plugin\Context\EntityContextDefinition;
 use Drupal\KernelTests\KernelTestBase;
 use Drupal\plugin_test\Plugin\TestPluginManager;
@@ -45,7 +46,7 @@ protected function setUp(): void {
     //   as derivatives and ReflectionFactory.
     $this->testPluginManager = new TestPluginManager();
     $this->mockBlockManager = new MockBlockManager();
-    $module_handler = new ModuleHandler($this->root, [], new MemoryBackend());
+    $module_handler = new ModuleHandler($this->root, [], new MemoryBackend(\Drupal::service(TimeInterface::class)));
     $this->defaultsTestPluginManager = new DefaultsTestPluginManager($module_handler);
 
     // The expected plugin definitions within each manager. Several tests assert
diff --git a/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php b/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php
index cb30230de41..7e354b4bf59 100644
--- a/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\KernelTests\Core\Routing;
 
 use ColinODell\PsrTestLogger\TestLogger;
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Core\Cache\MemoryBackend;
 use Drupal\Core\Database\Database;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
@@ -103,7 +104,7 @@ protected function setUp(): void {
     $this->fixtures = new RoutingFixtures();
     $this->state = new State(new KeyValueMemoryFactory());
     $this->currentPath = new CurrentPathStack(new RequestStack());
-    $this->cache = new MemoryBackend();
+    $this->cache = new MemoryBackend(\Drupal::service(TimeInterface::class));
     $this->pathProcessor = \Drupal::service('path_processor_manager');
     $this->cacheTagsInvalidator = \Drupal::service('cache_tags.invalidator');
     $this->installEntitySchema('path_alias');
diff --git a/core/tests/Drupal/KernelTests/KernelTestBase.php b/core/tests/Drupal/KernelTests/KernelTestBase.php
index c98b77fd9fe..6223acdfe27 100644
--- a/core/tests/Drupal/KernelTests/KernelTestBase.php
+++ b/core/tests/Drupal/KernelTests/KernelTestBase.php
@@ -556,13 +556,17 @@ public function register(ContainerBuilder $container) {
     // Keep the container object around for tests.
     $this->container = $container;
 
+    $container
+      ->register('datetime.time', 'Drupal\Component\Datetime\Time')
+      ->addArgument(new Reference('request_stack'));
     $container
       ->register('flood', 'Drupal\Core\Flood\MemoryBackend')
       ->addArgument(new Reference('request_stack'));
     $container
       ->register('lock', 'Drupal\Core\Lock\NullLockBackend');
     $container
-      ->register('cache_factory', 'Drupal\Core\Cache\MemoryBackendFactory');
+      ->register('cache_factory', 'Drupal\Core\Cache\MemoryBackendFactory')
+      ->addArgument(new Reference('datetime.time'));
 
     // Use memory for key value storages to avoid database queries. Store the
     // key value factory on the test object so that key value storages persist
diff --git a/core/tests/Drupal/Tests/Core/Asset/AssetResolverTest.php b/core/tests/Drupal/Tests/Core/Asset/AssetResolverTest.php
index 76ee6d23f87..a5246ad1f64 100644
--- a/core/tests/Drupal/Tests/Core/Asset/AssetResolverTest.php
+++ b/core/tests/Drupal/Tests/Core/Asset/AssetResolverTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Tests\Core\Asset;
 
+use Drupal\Component\Datetime\Time;
 use Drupal\Core\Asset\AssetResolver;
 use Drupal\Core\Asset\AttachedAssets;
 use Drupal\Core\Asset\AttachedAssetsInterface;
@@ -119,7 +120,7 @@ protected function setUp(): void {
     $this->languageManager->expects($this->any())
       ->method('getCurrentLanguage')
       ->will($this->onConsecutiveCalls($english, $english, $japanese, $japanese));
-    $this->cache = new TestMemoryBackend();
+    $this->cache = new TestMemoryBackend(new Time($this->createMock('Symfony\Component\HttpFoundation\RequestStack')));
 
     $this->assetResolver = new AssetResolver($this->libraryDiscovery, $this->libraryDependencyResolver, $this->moduleHandler, $this->themeManager, $this->languageManager, $this->cache);
   }
diff --git a/core/tests/Drupal/Tests/Core/Cache/BackendChainImplementationUnitTest.php b/core/tests/Drupal/Tests/Core/Cache/BackendChainImplementationUnitTest.php
index 9be88bbcb1a..5a3a138ad80 100644
--- a/core/tests/Drupal/Tests/Core/Cache/BackendChainImplementationUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/BackendChainImplementationUnitTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Cache;
 
+use Drupal\Component\Datetime\Time;
 use Drupal\Core\Cache\BackendChain;
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Cache\MemoryBackend;
@@ -50,9 +51,10 @@ protected function setUp(): void {
     parent::setUp();
 
     // Set up three memory backends to be used in the chain.
-    $this->firstBackend = new MemoryBackend();
-    $this->secondBackend = new MemoryBackend();
-    $this->thirdBackend = new MemoryBackend();
+    $time = new Time($this->createMock('Symfony\Component\HttpFoundation\RequestStack'));
+    $this->firstBackend = new MemoryBackend($time);
+    $this->secondBackend = new MemoryBackend($time);
+    $this->thirdBackend = new MemoryBackend($time);
 
     // Set an initial fixed dataset for all testing. The next three data
     // collections will test two edge cases (last backend has the data, and
diff --git a/core/tests/Drupal/Tests/Core/Cache/ChainedFastBackendTest.php b/core/tests/Drupal/Tests/Core/Cache/ChainedFastBackendTest.php
index ac5fb40a3b9..b405c3d0ceb 100644
--- a/core/tests/Drupal/Tests/Core/Cache/ChainedFastBackendTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/ChainedFastBackendTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Cache;
 
+use Drupal\Component\Datetime\Time;
 use Drupal\Core\Cache\ChainedFastBackend;
 use Drupal\Core\Cache\MemoryBackend;
 use Drupal\Tests\UnitTestCase;
@@ -47,7 +48,7 @@ public function testGetDoesNotHitConsistentBackend() {
     $consistent_cache->expects($this->never())
       ->method('getMultiple');
 
-    $fast_cache = new MemoryBackend();
+    $fast_cache = new MemoryBackend(new Time($this->createMock('Symfony\Component\HttpFoundation\RequestStack')));
     $fast_cache->set('foo', 'baz');
 
     $chained_fast_backend = new ChainedFastBackend(
diff --git a/core/tests/Drupal/Tests/Core/Cache/DatabaseBackendFactoryTest.php b/core/tests/Drupal/Tests/Core/Cache/DatabaseBackendFactoryTest.php
index 9d5ac4bdf92..9e3970cb397 100644
--- a/core/tests/Drupal/Tests/Core/Cache/DatabaseBackendFactoryTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/DatabaseBackendFactoryTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Cache;
 
+use Drupal\Component\Datetime\TimeInterface;
 use Drupal\Core\Cache\CacheTagsChecksumInterface;
 use Drupal\Core\Cache\DatabaseBackend;
 use Drupal\Core\Cache\DatabaseBackendFactory;
@@ -24,7 +25,8 @@ public function testGet(array $settings, $expected_max_rows_foo, $expected_max_r
     $database_backend_factory = new DatabaseBackendFactory(
       $this->prophesize(Connection::class)->reveal(),
       $this->prophesize(CacheTagsChecksumInterface::class)->reveal(),
-      new Settings($settings)
+      new Settings($settings),
+      $this->prophesize(TimeInterface::class)->reveal(),
     );
 
     $this->assertSame($expected_max_rows_foo, $database_backend_factory->get('foo')->getMaxRows());
diff --git a/core/tests/Drupal/Tests/Core/Cache/VariationCacheTest.php b/core/tests/Drupal/Tests/Core/Cache/VariationCacheTest.php
index 60f50db4155..3bec29af690 100644
--- a/core/tests/Drupal/Tests/Core/Cache/VariationCacheTest.php
+++ b/core/tests/Drupal/Tests/Core/Cache/VariationCacheTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Cache;
 
+use Drupal\Component\Datetime\Time;
 use Drupal\Core\Cache\CacheableMetadata;
 use Drupal\Core\Cache\CacheRedirect;
 use Drupal\Core\Cache\Context\CacheContextsManager;
@@ -123,7 +124,7 @@ class VariationCacheTest extends UnitTestCase {
   protected function setUp(): void {
     parent::setUp();
     $this->requestStack = $this->prophesize(RequestStack::class);
-    $this->memoryBackend = new MemoryBackend();
+    $this->memoryBackend = new MemoryBackend(new Time($this->createMock('Symfony\Component\HttpFoundation\RequestStack')));
     $this->cacheContextsManager = $this->prophesize(CacheContextsManager::class);
 
     $housing_type = &$this->housingType;
diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php
index 65c70288f96..4195f916b51 100644
--- a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Config\Entity;
 
+use Drupal\Component\Datetime\Time;
 use Drupal\Component\Uuid\UuidInterface;
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
@@ -137,7 +138,7 @@ protected function setUp(): void {
     $entity_query_factory = $this->prophesize(QueryFactoryInterface::class);
     $entity_query_factory->get($entity_type, 'AND')->willReturn($this->entityQuery->reveal());
 
-    $this->entityStorage = new ConfigEntityStorage($entity_type, $this->configFactory->reveal(), $this->uuidService->reveal(), $this->languageManager->reveal(), new MemoryCache());
+    $this->entityStorage = new ConfigEntityStorage($entity_type, $this->configFactory->reveal(), $this->uuidService->reveal(), $this->languageManager->reveal(), new MemoryCache(new Time($this->createMock('Symfony\Component\HttpFoundation\RequestStack'))));
     $this->entityStorage->setModuleHandler($this->moduleHandler->reveal());
 
     $entity_type_manager = $this->prophesize(EntityTypeManagerInterface::class);
diff --git a/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php b/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php
index ea94a0c07ce..475973933f2 100644
--- a/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Entity\KeyValueStore;
 
+use Drupal\Component\Datetime\Time;
 use Drupal\Core\Cache\MemoryCache\MemoryCache;
 use Drupal\Core\Config\Entity\ConfigEntityInterface;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
@@ -135,7 +136,7 @@ protected function setUpKeyValueEntityStorage($uuid_key = 'uuid') {
       ->method('getCurrentLanguage')
       ->willReturn($language);
 
-    $this->entityStorage = new KeyValueEntityStorage($this->entityType, $this->keyValueStore, $this->uuidService, $this->languageManager, new MemoryCache());
+    $this->entityStorage = new KeyValueEntityStorage($this->entityType, $this->keyValueStore, $this->uuidService, $this->languageManager, new MemoryCache(new Time($this->createMock('Symfony\Component\HttpFoundation\RequestStack'))));
     $this->entityStorage->setModuleHandler($this->moduleHandler);
 
     $container = new ContainerBuilder();
diff --git a/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php b/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php
index 749c33cba22..20e17663ec2 100644
--- a/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Tests\Core\Entity\Sql;
 
+use Drupal\Component\Datetime\Time;
 use Drupal\Core\Cache\MemoryCache\MemoryCache;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\Entity\EntityFieldManager;
@@ -429,7 +430,7 @@ public function testOnEntityTypeCreate() {
       ->willReturn($schema_handler);
 
     $storage = $this->getMockBuilder('Drupal\Core\Entity\Sql\SqlContentEntityStorage')
-      ->setConstructorArgs([$this->entityType, $this->connection, $this->entityFieldManager->reveal(), $this->cache, $this->languageManager, new MemoryCache(), $this->entityTypeBundleInfo, $this->entityTypeManager->reveal()])
+      ->setConstructorArgs([$this->entityType, $this->connection, $this->entityFieldManager->reveal(), $this->cache, $this->languageManager, new MemoryCache(new Time($this->createMock('Symfony\Component\HttpFoundation\RequestStack'))), $this->entityTypeBundleInfo, $this->entityTypeManager->reveal()])
       ->onlyMethods(['getStorageSchema'])
       ->getMock();
 
@@ -1178,7 +1179,7 @@ protected function setUpEntityStorage() {
       ->getActiveFieldStorageDefinitions($this->entityType->id())
       ->willReturn($this->fieldDefinitions);
 
-    $this->entityStorage = new SqlContentEntityStorage($this->entityType, $this->connection, $this->entityFieldManager->reveal(), $this->cache, $this->languageManager, new MemoryCache(), $this->entityTypeBundleInfo, $this->entityTypeManager->reveal());
+    $this->entityStorage = new SqlContentEntityStorage($this->entityType, $this->connection, $this->entityFieldManager->reveal(), $this->cache, $this->languageManager, new MemoryCache(new Time($this->createMock('Symfony\Component\HttpFoundation\RequestStack'))), $this->entityTypeBundleInfo, $this->entityTypeManager->reveal());
     $this->entityStorage->setModuleHandler($this->moduleHandler);
   }
 
@@ -1252,7 +1253,7 @@ public function testLoadMultipleNoPersistentCache() {
       ->willReturn($this->entityType);
 
     $entity_storage = $this->getMockBuilder('Drupal\Core\Entity\Sql\SqlContentEntityStorage')
-      ->setConstructorArgs([$this->entityType, $this->connection, $this->entityFieldManager->reveal(), $this->cache, $this->languageManager, new MemoryCache(), $this->entityTypeBundleInfo, $this->entityTypeManager->reveal()])
+      ->setConstructorArgs([$this->entityType, $this->connection, $this->entityFieldManager->reveal(), $this->cache, $this->languageManager, new MemoryCache(new Time($this->createMock('Symfony\Component\HttpFoundation\RequestStack'))), $this->entityTypeBundleInfo, $this->entityTypeManager->reveal()])
       ->onlyMethods(['getFromStorage', 'invokeStorageLoadHook', 'initTableLayout'])
       ->getMock();
     $entity_storage->method('invokeStorageLoadHook')
@@ -1312,7 +1313,7 @@ public function testLoadMultiplePersistentCacheMiss() {
       ->willReturn($this->entityType);
 
     $entity_storage = $this->getMockBuilder('Drupal\Core\Entity\Sql\SqlContentEntityStorage')
-      ->setConstructorArgs([$this->entityType, $this->connection, $this->entityFieldManager->reveal(), $this->cache, $this->languageManager, new MemoryCache(), $this->entityTypeBundleInfo, $this->entityTypeManager->reveal()])
+      ->setConstructorArgs([$this->entityType, $this->connection, $this->entityFieldManager->reveal(), $this->cache, $this->languageManager, new MemoryCache(new Time($this->createMock('Symfony\Component\HttpFoundation\RequestStack'))), $this->entityTypeBundleInfo, $this->entityTypeManager->reveal()])
       ->onlyMethods(['getFromStorage', 'invokeStorageLoadHook', 'initTableLayout'])
       ->getMock();
     $entity_storage->method('invokeStorageLoadHook')
@@ -1373,7 +1374,7 @@ public function testHasData() {
       ->getActiveFieldStorageDefinitions($this->entityType->id())
       ->willReturn($this->fieldDefinitions);
 
-    $this->entityStorage = new SqlContentEntityStorage($this->entityType, $database, $this->entityFieldManager->reveal(), $this->cache, $this->languageManager, new MemoryCache(), $this->entityTypeBundleInfo, $this->entityTypeManager->reveal());
+    $this->entityStorage = new SqlContentEntityStorage($this->entityType, $database, $this->entityFieldManager->reveal(), $this->cache, $this->languageManager, new MemoryCache(new Time($this->createMock('Symfony\Component\HttpFoundation\RequestStack'))), $this->entityTypeBundleInfo, $this->entityTypeManager->reveal());
 
     $result = $this->entityStorage->hasData();
 
diff --git a/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php b/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php
index 88517acc6e7..6bd82f74b1b 100644
--- a/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Tests\Core\Render;
 
+use Drupal\Component\Datetime\Time;
 use Drupal\Core\Cache\CacheableMetadata;
 use Drupal\Core\Cache\MemoryBackend;
 use Drupal\Core\Cache\VariationCache;
@@ -83,8 +84,8 @@ public function testContextBubblingCustomCacheBin() {
     $bin = $this->randomMachineName();
 
     $this->setUpRequest();
-    $this->memoryCache = new VariationCache($this->requestStack, new MemoryBackend(), $this->cacheContextsManager);
-    $custom_cache = new VariationCache($this->requestStack, new MemoryBackend(), $this->cacheContextsManager);
+    $this->memoryCache = new VariationCache($this->requestStack, new MemoryBackend(new Time($this->createMock('Symfony\Component\HttpFoundation\RequestStack'))), $this->cacheContextsManager);
+    $custom_cache = new VariationCache($this->requestStack, new MemoryBackend(new Time($this->createMock('Symfony\Component\HttpFoundation\RequestStack'))), $this->cacheContextsManager);
 
     $this->cacheFactory->expects($this->atLeastOnce())
       ->method('get')
diff --git a/core/tests/Drupal/Tests/Core/Render/RendererTestBase.php b/core/tests/Drupal/Tests/Core/Render/RendererTestBase.php
index 631fccc5611..3787738d81a 100644
--- a/core/tests/Drupal/Tests/Core/Render/RendererTestBase.php
+++ b/core/tests/Drupal/Tests/Core/Render/RendererTestBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Tests\Core\Render;
 
+use Drupal\Component\Datetime\Time;
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Cache\CacheableMetadata;
 use Drupal\Core\Cache\Context\ContextCacheKeys;
@@ -221,7 +222,7 @@ protected function setUpUnusedCache() {
    * Sets up a memory-based render cache back-end.
    */
   protected function setupMemoryCache() {
-    $this->memoryCache = $this->memoryCache ?: new VariationCache($this->requestStack, new MemoryBackend(), $this->cacheContextsManager);
+    $this->memoryCache = $this->memoryCache ?: new VariationCache($this->requestStack, new MemoryBackend(new Time($this->requestStack)), $this->cacheContextsManager);
 
     $this->cacheFactory->expects($this->atLeastOnce())
       ->method('get')
diff --git a/core/tests/Drupal/Tests/Core/Session/UserSessionTest.php b/core/tests/Drupal/Tests/Core/Session/UserSessionTest.php
index 7d4da73a735..ac9a4ceff4b 100644
--- a/core/tests/Drupal/Tests/Core/Session/UserSessionTest.php
+++ b/core/tests/Drupal/Tests/Core/Session/UserSessionTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\Core\Session;
 
+use Drupal\Component\Datetime\Time;
 use Drupal\Core\Cache\MemoryCache\MemoryCache;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\Session\PermissionChecker;
@@ -96,7 +97,7 @@ protected function setUp(): void {
       ]);
 
     $role_storage = $this->getMockBuilder('Drupal\user\RoleStorage')
-      ->setConstructorArgs(['role', new MemoryCache()])
+      ->setConstructorArgs(['role', new MemoryCache(new Time($this->createMock('Symfony\Component\HttpFoundation\RequestStack')))])
       ->disableOriginalConstructor()
       ->onlyMethods(['loadMultiple'])
       ->getMock();
