diff --git a/scheduler.install b/scheduler.install
index 2e4982b..55a866f 100644
--- a/scheduler.install
+++ b/scheduler.install
@@ -17,7 +17,7 @@ function scheduler_requirements($phase) {
   if ($phase === 'runtime') {
     $user = \Drupal::currentUser();
 
-    $now = REQUEST_TIME;
+    $now = \Drupal::time()->getRequestTime();
     $system_date = \Drupal::config('system.date');
     $date_default_timezone = $system_date->get('timezone.default') ?: date_default_timezone_get();
     $date_formatter = \Drupal::service('date.formatter');
diff --git a/scheduler.module b/scheduler.module
index 9f86b4d..f28889e 100644
--- a/scheduler.module
+++ b/scheduler.module
@@ -327,14 +327,14 @@ function scheduler_node_presave(EntityInterface $node) {
       if (rand(1, 100) <= $publishing_percent) {
         // Randomly assign a publish_on value in the range starting with the
         // created date and up to the selected time range in the future.
-        $node->set('publish_on', rand($node->created->value + 1, REQUEST_TIME + $time_range));
+        $node->set('publish_on', rand($node->created->value + 1, \Drupal::time()->getRequestTime() + $time_range));
       }
     }
     if ($unpublishing_percent && in_array($node->getType(), $unpublishing_enabled_types)) {
       if (rand(1, 100) <= $unpublishing_percent) {
         // Randomly assign an unpublish_on value in the range from the later of
         // created date/publish_on date up to the time range in the future.
-        $node->set('unpublish_on', rand(max($node->created->value, $node->publish_on->value), REQUEST_TIME + $time_range));
+        $node->set('unpublish_on', rand(max($node->created->value, $node->publish_on->value), \Drupal::time()->getRequestTime() + $time_range));
       }
     }
   }
@@ -349,7 +349,7 @@ function scheduler_node_presave(EntityInterface $node) {
     // Publish the node immediately if the publication date is in the past.
     $publish_immediately = $entity->getThirdPartySetting('scheduler', 'publish_past_date', $config->get('default_publish_past_date')) == 'publish';
 
-    if ($publication_allowed && $publish_immediately && $node->publish_on->value <= REQUEST_TIME) {
+    if ($publication_allowed && $publish_immediately && $node->publish_on->value <= \Drupal::time()->getRequestTime()) {
       // Trigger the PRE_PUBLISH_INMEDIATELY event so that modules can react
       // before the node has been published.
       $event = new SchedulerEvent($node);
diff --git a/scheduler_handler_field_scheduler_countdown.inc b/scheduler_handler_field_scheduler_countdown.inc
index 9794a58..a518f51 100644
--- a/scheduler_handler_field_scheduler_countdown.inc
+++ b/scheduler_handler_field_scheduler_countdown.inc
@@ -32,7 +32,7 @@ class SchedulerHandlerFieldSchedulerCountdown extends views_handler_field {
     $this->ensure_my_table();
     $this->node_table = $this->query->ensure_table('node', $this->relationship);
     $time_field = $this->definition['timestamp_field'];
-    $this->field_alias = $this->query->add_field(NULL, 'CASE WHEN (' . $time_field . ' > ' . REQUEST_TIME . ') THEN (' . $time_field . ' - ' . REQUEST_TIME . ') ELSE NULL END', $this->table_alias . '_' . $this->field);
+    $this->field_alias = $this->query->add_field(NULL, 'CASE WHEN (' . $time_field . ' > ' . \Drupal::time()->getRequestTime() . ') THEN (' . $time_field . ' - ' . \Drupal::time()->getRequestTime() . ') ELSE NULL END', $this->table_alias . '_' . $this->field);
   }
 
   /**
diff --git a/src/Plugin/Validation/Constraint/SchedulerPublishOnConstraintValidator.php b/src/Plugin/Validation/Constraint/SchedulerPublishOnConstraintValidator.php
index 51ccff9..b4963e1 100644
--- a/src/Plugin/Validation/Constraint/SchedulerPublishOnConstraintValidator.php
+++ b/src/Plugin/Validation/Constraint/SchedulerPublishOnConstraintValidator.php
@@ -18,7 +18,7 @@ class SchedulerPublishOnConstraintValidator extends ConstraintValidator {
     $default_publish_past_date = \Drupal::config('scheduler.settings')->get('default_publish_past_date');
     $scheduler_publish_past_date = $entity->getEntity()->type->entity->getThirdPartySetting('scheduler', 'publish_past_date', $default_publish_past_date);
 
-    if ($publish_on && $scheduler_publish_past_date == 'error' && $publish_on < REQUEST_TIME) {
+    if ($publish_on && $scheduler_publish_past_date == 'error' && $publish_on < \Drupal::time()->getRequestTime()) {
       $this->context->buildViolation($constraint->messagePublishOnDateNotInFuture)
         ->atPath('publish_on')
         ->addViolation();
diff --git a/src/Plugin/Validation/Constraint/SchedulerUnpublishOnConstraintValidator.php b/src/Plugin/Validation/Constraint/SchedulerUnpublishOnConstraintValidator.php
index 05da801..6246445 100644
--- a/src/Plugin/Validation/Constraint/SchedulerUnpublishOnConstraintValidator.php
+++ b/src/Plugin/Validation/Constraint/SchedulerUnpublishOnConstraintValidator.php
@@ -40,7 +40,7 @@ class SchedulerUnpublishOnConstraintValidator extends ConstraintValidator {
     // Check that the unpublish-on date is in the future. Unlike the publish-on
     // field, there is no option to use a past date, as this is not relevant for
     // unpublshing. The date must ALWAYS be in the future if it is entered.
-    if ($unpublish_on && $unpublish_on < REQUEST_TIME) {
+    if ($unpublish_on && $unpublish_on < \Drupal::time()->getRequestTime()) {
       $this->context->buildViolation($constraint->messageUnpublishOnDateNotInFuture)
         ->atPath('unpublish_on')
         ->addViolation();
diff --git a/src/SchedulerManager.php b/src/SchedulerManager.php
index de17b18..fd639f6 100644
--- a/src/SchedulerManager.php
+++ b/src/SchedulerManager.php
@@ -91,7 +91,7 @@ class SchedulerManager {
       // Replace \Drupal::entityQuery with dependency injection?
       $query = \Drupal::entityQuery('node')
         ->exists('publish_on')
-        ->condition('publish_on', REQUEST_TIME, '<=')
+        ->condition('publish_on', \Drupal::time()->getRequestTime(), '<=')
         ->condition('type', $scheduler_enabled_types, 'IN')
         ->sort('publish_on')
         ->sort('nid');
@@ -131,7 +131,7 @@ class SchedulerManager {
         // If the current translation does not have a publish on value, or it is
         // later than the date we are processing then move on to the next.
         $publish_on = $node->publish_on->value;
-        if (empty($publish_on) || $publish_on > REQUEST_TIME) {
+        if (empty($publish_on) || $publish_on > \Drupal::time()->getRequestTime()) {
           continue;
         }
 
@@ -171,7 +171,7 @@ class SchedulerManager {
           // @TODO: 't' calls should be avoided in classes.
           // Replace with dependency injection?
           $node->revision_log = t('Node published by Scheduler on @now. Previous creation date was @date.', [
-            '@now' => $this->dateFormatter->format(REQUEST_TIME, 'short'),
+            '@now' => $this->dateFormatter->format(\Drupal::time()->getRequestTime(), 'short'),
             '@date' => $this->dateFormatter->format($old_creation_date, 'short'),
           ]);
         }
@@ -240,7 +240,7 @@ class SchedulerManager {
       // Replace \Drupal::entityQuery with dependency injection?
       $query = \Drupal::entityQuery('node')
         ->exists('unpublish_on')
-        ->condition('unpublish_on', REQUEST_TIME, '<=')
+        ->condition('unpublish_on', \Drupal::time()->getRequestTime(), '<=')
         ->condition('type', $scheduler_enabled_types, 'IN')
         ->sort('unpublish_on')
         ->sort('nid');
@@ -274,7 +274,7 @@ class SchedulerManager {
         // If the current translation does not have an unpublish on value, or it
         // is later than the date we are processing then move on to the next.
         $unpublish_on = $node->unpublish_on->value;
-        if (empty($unpublish_on) || $unpublish_on > REQUEST_TIME) {
+        if (empty($unpublish_on) || $unpublish_on > \Drupal::time()->getRequestTime()) {
           continue;
         }
 
@@ -283,7 +283,7 @@ class SchedulerManager {
         // by one of the hook functions we provide, and is still being blocked
         // now that the unpublishing time has been reached.
         $publish_on = $node->publish_on->value;
-        if (!empty($publish_on) && $publish_on <= REQUEST_TIME) {
+        if (!empty($publish_on) && $publish_on <= \Drupal::time()->getRequestTime()) {
           continue;
         }
 
@@ -320,7 +320,7 @@ class SchedulerManager {
           // @TODO: 't' calls should be avoided in classes.
           // Replace with dependency injection?
           $node->revision_log = t('Node unpublished by Scheduler on @now. Previous change date was @date.', [
-            '@now' => $this->dateFormatter->format(REQUEST_TIME, 'short'),
+            '@now' => $this->dateFormatter->format(\Drupal::time()->getRequestTime(), 'short'),
             '@date' => $this->dateFormatter->format($old_change_date, 'short'),
           ]);
         }
diff --git a/tests/modules/scheduler_api_test/scheduler_api_test.module b/tests/modules/scheduler_api_test/scheduler_api_test.module
index 70f0286..4d90d13 100644
--- a/tests/modules/scheduler_api_test/scheduler_api_test.module
+++ b/tests/modules/scheduler_api_test/scheduler_api_test.module
@@ -16,18 +16,18 @@ function scheduler_api_test_scheduler_nid_list($action) {
   // Check to see what test nodes exist.
   $query = \Drupal::entityQuery('node');
   $nodes = Node::loadMultiple($query->execute());
-
+  $request_time = \Drupal::time()->getRequestTime();
   foreach ($nodes as $nid => $node) {
     // If publishing and this is the publish test node, set a date and add
     // the node id to the list.
     if ($action == 'publish' && $node->title->value == 'API TEST nid_list publish me') {
-      $node->set('publish_on', REQUEST_TIME)->save();
+      $node->set('publish_on', $request_time)->save();
       $nids[] = $nid;
     }
     // If unpublishing and this is the unpublish test node, set a date and add
     // the node id to the list.
     if ($action == 'unpublish' && $node->title->value == 'API TEST nid_list unpublish me') {
-      $node->set('unpublish_on', REQUEST_TIME)->save();
+      $node->set('unpublish_on', $request_time)->save();
       $nids[] = $nid;
     }
   }
@@ -40,7 +40,7 @@ function scheduler_api_test_scheduler_nid_list($action) {
 function scheduler_api_test_scheduler_nid_list_alter(&$nids, $action) {
   $query = \Drupal::entityQuery('node');
   $nodes = Node::loadMultiple($query->execute());
-
+  $request_time = \Drupal::time()->getRequestTime();
   foreach ($nodes as $nid => $node) {
     if ($action == 'publish' && $node->title->value == 'API TEST nid_list_alter do not publish me') {
       // Remove the node id.
@@ -48,7 +48,7 @@ function scheduler_api_test_scheduler_nid_list_alter(&$nids, $action) {
     }
     if ($action == 'publish' && $node->title->value == 'API TEST nid_list_alter publish me') {
       // Set a publish_on date and add the node id.
-      $node->set('publish_on', REQUEST_TIME)->save();
+      $node->set('publish_on', $request_time)->save();
       $nids[] = $nid;
     }
     if ($action == 'unpublish' && $node->title->value == 'API TEST nid_list_alter do not unpublish me') {
@@ -57,7 +57,7 @@ function scheduler_api_test_scheduler_nid_list_alter(&$nids, $action) {
     }
     if ($action == 'unpublish' && $node->title->value == 'API TEST nid_list_alter unpublish me') {
       // Set an unpublish_on date and add the node id.
-      $node->set('unpublish_on', REQUEST_TIME)->save();
+      $node->set('unpublish_on', $request_time)->save();
       $nids[] = $nid;
     }
   }
@@ -81,7 +81,7 @@ function scheduler_api_test_scheduler_allow_publishing($node) {
       // If the time is in the past it means that the action has been prevented.
       // Write a dblog message to show this. Give a link to view the node but
       // cater for no nid as the node may be new and not yet saved.
-      if ($node->publish_on->value <= REQUEST_TIME) {
+      if ($node->publish_on->value <= \Drupal::time()->getRequestTime()) {
         \Drupal::logger('scheduler_api_test')->warning('Publishing of "%title" is prevented until approved.', [
           '%title' => $node->title->value,
           'link' => $node->id() ? $node->link(t('View node')) : '',
@@ -109,7 +109,7 @@ function scheduler_api_test_scheduler_allow_unpublishing($node) {
       // If the time is in the past it means that the action has been prevented.
       // Write a dblog message to show this. Give a link to view the node but
       // cater for no nid as the node may be new and not yet saved.
-      if ($node->unpublish_on->value <= REQUEST_TIME) {
+      if ($node->unpublish_on->value <= \Drupal::time()->getRequestTime()) {
         \Drupal::logger('scheduler_api_test')->warning('Unpublishing of "%title" is prevented until approved.', [
           '%title' => $node->title->value,
           'link' => $node->id() ? $node->link(t('View node')) : '',
diff --git a/tests/src/Functional/SchedulerApiTest.php b/tests/src/Functional/SchedulerApiTest.php
index 278beaa..1fe10a4 100644
--- a/tests/src/Functional/SchedulerApiTest.php
+++ b/tests/src/Functional/SchedulerApiTest.php
@@ -253,9 +253,10 @@ class SchedulerApiTest extends SchedulerBrowserTestBase {
     $node->set('sticky', FALSE)->set('promote', FALSE)->save();
 
     // Edit the node and set a publish-on date in the past.
+    $request_time = \Drupal::time()->getRequestTime();
     $edit = [
-      'publish_on[0][value][date]' => date('Y-m-d', strtotime('-2 day', REQUEST_TIME)),
-      'publish_on[0][value][time]' => date('H:i:s', strtotime('-2 day', REQUEST_TIME)),
+      'publish_on[0][value][date]' => date('Y-m-d', strtotime('-2 day', $request_time)),
+      'publish_on[0][value][time]' => date('H:i:s', strtotime('-2 day', $request_time)),
     ];
     $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
     // Verify that the values have been altered as expected.
diff --git a/tests/src/Functional/SchedulerBasicTest.php b/tests/src/Functional/SchedulerBasicTest.php
index 3e7920f..b5ac6fe 100644
--- a/tests/src/Functional/SchedulerBasicTest.php
+++ b/tests/src/Functional/SchedulerBasicTest.php
@@ -63,7 +63,7 @@ class SchedulerBasicTest extends SchedulerBrowserTestBase {
     }
 
     // Modify the scheduler field data to a time in the past, then run cron.
-    $node->$key = REQUEST_TIME - 1;
+    $node->$key = \Drupal::time()->getRequestTime() - 1;
     $node->save();
     $this->cronRun();
 
diff --git a/tests/src/Functional/SchedulerDefaultTimeTest.php b/tests/src/Functional/SchedulerDefaultTimeTest.php
index a0d0a22..d3b8a06 100644
--- a/tests/src/Functional/SchedulerDefaultTimeTest.php
+++ b/tests/src/Functional/SchedulerDefaultTimeTest.php
@@ -37,12 +37,12 @@ class SchedulerDefaultTimeTest extends SchedulerBrowserTestBase {
 
     // First test with the "date only" functionality disabled.
     $config->set('allow_date_only', FALSE)->save();
-
+    $request_time = \Drupal::time()->getRequestTime();
     // Test that entering a time is required.
     $edit = [
       'title[0][value]' => 'No time ' . $this->randomString(15),
-      'publish_on[0][value][date]' => $date_formatter->format(strtotime('+1 day', REQUEST_TIME), 'custom', 'Y-m-d'),
-      'unpublish_on[0][value][date]' => $date_formatter->format(strtotime('+2 day', REQUEST_TIME), 'custom', 'Y-m-d'),
+      'publish_on[0][value][date]' => $date_formatter->format(strtotime('+1 day', $request_time), 'custom', 'Y-m-d'),
+      'unpublish_on[0][value][date]' => $date_formatter->format(strtotime('+2 day', $request_time), 'custom', 'Y-m-d'),
     ];
     // Create a node and check that the expected error messages are shown.
     $this->drupalPostForm('node/add/' . $this->type, $edit, t('Save'));
@@ -58,8 +58,8 @@ class SchedulerDefaultTimeTest extends SchedulerBrowserTestBase {
     $this->assertSession()->pageTextNotContains($unpublish_validation_message, 'If the default time option is enabled the user can skip the time when scheduling content for unpublication.');
 
     // Check that the scheduled information is shown after saving.
-    $publish_time = strtotime('+1 day midnight', REQUEST_TIME) + $seconds;
-    $unpublish_time = strtotime('+2 day midnight', REQUEST_TIME) + $seconds;
+    $publish_time = strtotime('+1 day midnight', $request_time) + $seconds;
+    $unpublish_time = strtotime('+2 day midnight', $request_time) + $seconds;
     $args = ['@publish_time' => $date_formatter->format($publish_time, 'long')];
     $this->assertRaw(t('This post is unpublished and will be published @publish_time.', $args), 'The user is informed that the content will be published on the requested date, on the default time.');
 
diff --git a/tests/src/Functional/SchedulerDevelGenerateTest.php b/tests/src/Functional/SchedulerDevelGenerateTest.php
index f1f5fc1..ef769e3 100644
--- a/tests/src/Functional/SchedulerDevelGenerateTest.php
+++ b/tests/src/Functional/SchedulerDevelGenerateTest.php
@@ -78,7 +78,8 @@ class SchedulerDevelGenerateTest extends SchedulerBrowserTestBase {
       // slowly creep forward during sucessive calls. Tests can fail incorrectly
       // for this reason, hence the best approximation is to use time() when
       // calculating the upper end of the range.
-      $min = REQUEST_TIME - $time_range;
+      $request_time = \Drupal::time()->getRequestTime();
+      $min = $request_time - $time_range;
       $max = time() + $time_range;
 
       $query = \Drupal::entityQueryAggregate('node');
diff --git a/tests/src/Functional/SchedulerMultilingualTest.php b/tests/src/Functional/SchedulerMultilingualTest.php
index 7823bc7..09c7de5 100644
--- a/tests/src/Functional/SchedulerMultilingualTest.php
+++ b/tests/src/Functional/SchedulerMultilingualTest.php
@@ -158,10 +158,11 @@ class SchedulerMultilingualTest extends SchedulerBrowserTestBase {
 
     // Create the second translation, to be published in the future.
     $this->drupalGet('node/' . $node->id() . '/translations/add/' . $this->languages[0]['code'] . '/' . $this->languages[2]['code']);
+    $request_time = \Drupal::time()->getRequestTime();
     $edit = [
       'title[0][value]' => $this->languages[2]['name'] . '(2) - Publish in the future',
-      'publish_on[0][value][date]' => date('Y-m-d', strtotime('+2 day', REQUEST_TIME)),
-      'publish_on[0][value][time]' => date('H:i:s', strtotime('+2 day', REQUEST_TIME)),
+      'publish_on[0][value][date]' => date('Y-m-d', strtotime('+2 day', $request_time)),
+      'publish_on[0][value][time]' => date('H:i:s', strtotime('+2 day', $request_time)),
     ];
     $this->submitForm($edit, $save_button_text);
 
@@ -169,8 +170,8 @@ class SchedulerMultilingualTest extends SchedulerBrowserTestBase {
     $this->drupalGet('node/' . $node->id() . '/translations/add/' . $this->languages[0]['code'] . '/' . $this->languages[3]['code']);
     $edit = [
       'title[0][value]' => $this->languages[3]['name'] . '(3) - Publish in the past',
-      'publish_on[0][value][date]' => date('Y-m-d', strtotime('-2 day', REQUEST_TIME)),
-      'publish_on[0][value][time]' => date('H:i:s', strtotime('-2 day', REQUEST_TIME)),
+      'publish_on[0][value][date]' => date('Y-m-d', strtotime('-2 day', $request_time)),
+      'publish_on[0][value][time]' => date('H:i:s', strtotime('-2 day', $request_time)),
     ];
     $this->submitForm($edit, $save_button_text);
 
diff --git a/tests/src/Functional/SchedulerNodeAccessTest.php b/tests/src/Functional/SchedulerNodeAccessTest.php
index 7f5f25f..aa9670c 100644
--- a/tests/src/Functional/SchedulerNodeAccessTest.php
+++ b/tests/src/Functional/SchedulerNodeAccessTest.php
@@ -57,7 +57,7 @@ class SchedulerNodeAccessTest extends SchedulerBrowserTestBase {
         'type' => $this->type,
         'status' => $data['status'],
         'title' => 'Test node to be ' . $data['after'],
-        $field => REQUEST_TIME + 1,
+        $field => \Drupal::time()->getRequestTime() + 1,
       ];
       $node = $this->drupalCreateNode($settings);
       $this->drupalGet('node/' . $node->id());
diff --git a/tests/src/Functional/SchedulerNonEnabledTypeTest.php b/tests/src/Functional/SchedulerNonEnabledTypeTest.php
index 79b162a..02b1b77 100644
--- a/tests/src/Functional/SchedulerNonEnabledTypeTest.php
+++ b/tests/src/Functional/SchedulerNonEnabledTypeTest.php
@@ -76,11 +76,12 @@ class SchedulerNonEnabledTypeTest extends SchedulerBrowserTestBase {
     // could be done by a third-party module, or a by-product of the node type
     // being enabled for publishing then being disabled before it got published.
     $title = $info . ' (' . $run_number . 'b)';
+    $request_time = \Drupal::time()->getRequestTime();
     $edit = [
       'title' => $title,
       'status' => 0,
       'type' => $this->contentName,
-      'publish_on' => REQUEST_TIME - 2,
+      'publish_on' => $request_time - 2,
     ];
     $node = $this->drupalCreateNode($edit);
 
@@ -107,7 +108,7 @@ class SchedulerNonEnabledTypeTest extends SchedulerBrowserTestBase {
       'title' => $title,
       'status' => 1,
       'type' => $this->contentName,
-      'unpublish_on' => REQUEST_TIME - 1,
+      'unpublish_on' => $request_time - 1,
     ];
     $node = $this->drupalCreateNode($edit);
 
diff --git a/tests/src/Functional/SchedulerPastDatesTest.php b/tests/src/Functional/SchedulerPastDatesTest.php
index e4c8305..0c93595 100644
--- a/tests/src/Functional/SchedulerPastDatesTest.php
+++ b/tests/src/Functional/SchedulerPastDatesTest.php
@@ -24,13 +24,13 @@ class SchedulerPastDatesTest extends SchedulerBrowserTestBase {
 
     // Create an unpublished page node.
     $node = $this->drupalCreateNode(['type' => $this->type, 'status' => FALSE]);
-
+    $request_time = \Drupal::time()->getRequestTime();
     // Test the default behavior: an error message should be shown when the user
     // enters a publication date that is in the past.
     $edit = [
       'title[0][value]' => 'Past ' . $this->randomString(10),
-      'publish_on[0][value][date]' => \Drupal::service('date.formatter')->format(strtotime('-1 day', REQUEST_TIME), 'custom', 'Y-m-d'),
-      'publish_on[0][value][time]' => \Drupal::service('date.formatter')->format(strtotime('-1 day', REQUEST_TIME), 'custom', 'H:i:s'),
+      'publish_on[0][value][date]' => \Drupal::service('date.formatter')->format(strtotime('-1 day', $request_time), 'custom', 'Y-m-d'),
+      'publish_on[0][value][time]' => \Drupal::service('date.formatter')->format(strtotime('-1 day', $request_time), 'custom', 'H:i:s'),
     ];
     $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
     $this->assertRaw(t("The 'publish on' date must be in the future"), 'An error message is shown by default when the publication date is in the past.');
@@ -66,7 +66,7 @@ class SchedulerPastDatesTest extends SchedulerBrowserTestBase {
     $this->nodeStorage->resetCache([$node->id()]);
     $node = $this->nodeStorage->load($node->id());
     $this->assertFalse($node->isPublished(), 'The node has been unpublished when the publication date is in the past and the "schedule" behavior is chosen.');
-    $this->assertEqual($node->publish_on->value, strtotime('-1 day', REQUEST_TIME), 'The node has the correct publish_on date stored.');
+    $this->assertEqual($node->publish_on->value, strtotime('-1 day', $request_time), 'The node has the correct publish_on date stored.');
 
     // Simulate a cron run and check that the node is published.
     scheduler_cron();
@@ -77,8 +77,8 @@ class SchedulerPastDatesTest extends SchedulerBrowserTestBase {
     // Check that an Unpublish date in the past fails validation.
     $edit = [
       'title[0][value]' => 'Unpublish in the past ' . $this->randomString(10),
-      'unpublish_on[0][value][date]' => \Drupal::service('date.formatter')->format(REQUEST_TIME - 3600, 'custom', 'Y-m-d'),
-      'unpublish_on[0][value][time]' => \Drupal::service('date.formatter')->format(REQUEST_TIME - 3600, 'custom', 'H:i:s'),
+      'unpublish_on[0][value][date]' => \Drupal::service('date.formatter')->format($request_time - 3600, 'custom', 'Y-m-d'),
+      'unpublish_on[0][value][time]' => \Drupal::service('date.formatter')->format($request_time - 3600, 'custom', 'H:i:s'),
     ];
     $this->drupalPostForm('node/add/' . $this->type, $edit, t('Save'));
     $this->assertRaw(t("The 'unpublish on' date must be in the future"), 'An error message is shown when the unpublish date is in the past.');
diff --git a/tests/src/Functional/SchedulerRevisioningTest.php b/tests/src/Functional/SchedulerRevisioningTest.php
index 8810e8d..27c03d7 100644
--- a/tests/src/Functional/SchedulerRevisioningTest.php
+++ b/tests/src/Functional/SchedulerRevisioningTest.php
@@ -26,7 +26,7 @@ class SchedulerRevisioningTest extends SchedulerBrowserTestBase {
   protected function schedule(NodeInterface $node, $action = 'publish') {
     // Simulate scheduling by setting the (un)publication date in the past and
     // running cron.
-    $node->{$action . '_on'} = strtotime('-1 day', REQUEST_TIME);
+    $node->{$action . '_on'} = strtotime('-1 day', \Drupal::time()->getRequestTime());
     $node->save();
     scheduler_cron();
     $this->nodeStorage->resetCache([$node->id()]);
@@ -91,7 +91,7 @@ class SchedulerRevisioningTest extends SchedulerBrowserTestBase {
    */
   public function testRevisioning() {
     // Create a scheduled node that is not automatically revisioned.
-    $created = strtotime('-2 day', REQUEST_TIME);
+    $created = strtotime('-2 day', \Drupal::time()->getRequestTime());
     $settings = [
       'type' => $this->type,
       'revision' => 0,
@@ -119,7 +119,7 @@ class SchedulerRevisioningTest extends SchedulerBrowserTestBase {
     $node = $this->schedule($node);
     $this->assertRevisionCount($node->id(), 2, 'A new revision was created when revisioning is enabled.');
     $expected_message = sprintf('Node published by Scheduler on %s. Previous creation date was %s.',
-      \Drupal::service('date.formatter')->format(REQUEST_TIME, 'short'),
+      \Drupal::service('date.formatter')->format(\Drupal::time()->getRequestTime(), 'short'),
       \Drupal::service('date.formatter')->format($created, 'short'));
     $this->assertRevisionLogMessage($node->id(), $expected_message, 'The correct message was found in the node revision log after scheduled publishing.');
 
@@ -127,8 +127,8 @@ class SchedulerRevisioningTest extends SchedulerBrowserTestBase {
     $node = $this->schedule($node, 'unpublish');
     $this->assertRevisionCount($node->id(), 3, 'A new revision was created when a node was unpublished with revisioning enabled.');
     $expected_message = sprintf('Node unpublished by Scheduler on %s. Previous change date was %s.',
-      \Drupal::service('date.formatter')->format(REQUEST_TIME, 'short'),
-      \Drupal::service('date.formatter')->format(REQUEST_TIME, 'short'));
+      \Drupal::service('date.formatter')->format(\Drupal::time()->getRequestTime(), 'short'),
+      \Drupal::service('date.formatter')->format(\Drupal::time()->getRequestTime(), 'short'));
     $this->assertRevisionLogMessage($node->id(), $expected_message, 'The correct message was found in the node revision log after scheduled unpublishing.');
   }
 
@@ -140,7 +140,7 @@ class SchedulerRevisioningTest extends SchedulerBrowserTestBase {
     $this->nodetype->setThirdPartySetting('scheduler', 'publish_past_date', 'schedule')->save();
 
     // Create a node with a 'created' date two days in the past.
-    $created = strtotime('-2 day', REQUEST_TIME);
+    $created = strtotime('-2 day', \Drupal::time()->getRequestTime());
     $settings = [
       'type' => $this->type,
       'created' => $created,
@@ -164,7 +164,7 @@ class SchedulerRevisioningTest extends SchedulerBrowserTestBase {
     $node = $this->schedule($node, 'publish');
     // Check that the created date has changed to match the publish_on date.
     $created_after_cron = $node->created->value;
-    $this->assertEqual(strtotime('-1 day', REQUEST_TIME), $created_after_cron, "With 'touch' option set, the node creation date is changed to match the publishing date.");
+    $this->assertEqual(strtotime('-1 day', \Drupal::time()->getRequestTime()), $created_after_cron, "With 'touch' option set, the node creation date is changed to match the publishing date.");
   }
 
 }
diff --git a/tests/src/Functional/SchedulerRulesActionsTest.php b/tests/src/Functional/SchedulerRulesActionsTest.php
index be0e881..3bf4b7f 100644
--- a/tests/src/Functional/SchedulerRulesActionsTest.php
+++ b/tests/src/Functional/SchedulerRulesActionsTest.php
@@ -60,7 +60,7 @@ class SchedulerRulesActionsTest extends SchedulerBrowserTestBase {
     $rule1->addAction('scheduler_set_publishing_date_action',
       ContextConfig::create()
         ->map('node', 'node')
-        ->setValue('date', REQUEST_TIME + 1800)
+        ->setValue('date', \Drupal::time()->getRequestTime() + 1800)
       )
       ->addAction('rules_system_message',
         ContextConfig::create()
@@ -182,7 +182,7 @@ class SchedulerRulesActionsTest extends SchedulerBrowserTestBase {
     $rule3->addAction('scheduler_set_unpublishing_date_action',
       ContextConfig::create()
         ->map('node', 'node')
-        ->setValue('date', REQUEST_TIME + 1800)
+        ->setValue('date', \Drupal::time()->getRequestTime() + 1800)
       )
       ->addAction('rules_system_message',
         ContextConfig::create()
diff --git a/tests/src/Functional/SchedulerRulesConditionsTest.php b/tests/src/Functional/SchedulerRulesConditionsTest.php
index a661326..bc455a5 100644
--- a/tests/src/Functional/SchedulerRulesConditionsTest.php
+++ b/tests/src/Functional/SchedulerRulesConditionsTest.php
@@ -236,9 +236,10 @@ class SchedulerRulesConditionsTest extends SchedulerBrowserTestBase {
     $this->assertNoText($message8, '"' . $message8 . '" is not shown');
 
     // Edit the node and set a publish_on date.
+    $request_time = \Drupal::time()->getRequestTime();
     $edit = [
-      'publish_on[0][value][date]' => date('Y-m-d', strtotime('+1 day', REQUEST_TIME)),
-      'publish_on[0][value][time]' => date('H:i:s', strtotime('+1 day', REQUEST_TIME)),
+      'publish_on[0][value][date]' => date('Y-m-d', strtotime('+1 day', $request_time)),
+      'publish_on[0][value][time]' => date('H:i:s', strtotime('+1 day', $request_time)),
     ];
     $this->drupalPostForm('node/' . $this->node->id() . '/edit', $edit, t('Save'));
 
@@ -249,8 +250,8 @@ class SchedulerRulesConditionsTest extends SchedulerBrowserTestBase {
 
     // Edit the node and set an unpublish_on date.
     $edit = [
-      'unpublish_on[0][value][date]' => date('Y-m-d', strtotime('+2 day', REQUEST_TIME)),
-      'unpublish_on[0][value][time]' => date('H:i:s', strtotime('+2 day', REQUEST_TIME)),
+      'unpublish_on[0][value][date]' => date('Y-m-d', strtotime('+2 day', $request_time)),
+      'unpublish_on[0][value][time]' => date('H:i:s', strtotime('+2 day', $request_time)),
     ];
     $this->drupalPostForm('node/' . $this->node->id() . '/edit', $edit, t('Save'));
 
diff --git a/tests/src/Functional/SchedulerTokenReplaceTest.php b/tests/src/Functional/SchedulerTokenReplaceTest.php
index ceb4487..3ebcf79 100644
--- a/tests/src/Functional/SchedulerTokenReplaceTest.php
+++ b/tests/src/Functional/SchedulerTokenReplaceTest.php
@@ -15,10 +15,10 @@ class SchedulerTokenReplaceTest extends SchedulerBrowserTestBase {
   public function testSchedulerTokenReplacement() {
     $this->drupalLogin($this->schedulerUser);
     $date_formatter = \Drupal::service('date.formatter');
-
+    $request_time = \Drupal::time()->getRequestTime();
     // Define timestamps for consistent use when repeated throughout this test.
-    $publish_on_timestamp = REQUEST_TIME + 3600;
-    $unpublish_on_timestamp = REQUEST_TIME + 7200;
+    $publish_on_timestamp = $request_time + 3600;
+    $unpublish_on_timestamp = $request_time + 7200;
 
     // Create an unpublished page with scheduled dates.
     $node = $this->drupalCreateNode([
diff --git a/tests/src/Functional/SchedulerValidationTest.php b/tests/src/Functional/SchedulerValidationTest.php
index 346ac01..1879b1b 100644
--- a/tests/src/Functional/SchedulerValidationTest.php
+++ b/tests/src/Functional/SchedulerValidationTest.php
@@ -29,9 +29,10 @@ class SchedulerValidationTest extends SchedulerBrowserTestBase {
       'type' => $this->type,
       'status' => FALSE,
     ]);
+    $request_time = \Drupal::time()->getRequestTime();
     $edit = [
-      'publish_on[0][value][date]' => date('Y-m-d', strtotime('+1 day', REQUEST_TIME)),
-      'publish_on[0][value][time]' => date('H:i:s', strtotime('+1 day', REQUEST_TIME)),
+      'publish_on[0][value][date]' => date('Y-m-d', strtotime('+1 day', $request_time)),
+      'publish_on[0][value][time]' => date('H:i:s', strtotime('+1 day', $request_time)),
     ];
     $this->drupalGet('node/' . $node->id() . '/edit');
 
@@ -68,11 +69,12 @@ class SchedulerValidationTest extends SchedulerBrowserTestBase {
       'type' => $this->type,
       'status' => FALSE,
     ]);
+    $request_time = \Drupal::time()->getRequestTime();
     $edit = [
-      'publish_on[0][value][date]' => \Drupal::service('date.formatter')->format(REQUEST_TIME + 8100, 'custom', 'Y-m-d'),
-      'publish_on[0][value][time]' => \Drupal::service('date.formatter')->format(REQUEST_TIME + 8100, 'custom', 'H:i:s'),
-      'unpublish_on[0][value][date]' => \Drupal::service('date.formatter')->format(REQUEST_TIME + 1800, 'custom', 'Y-m-d'),
-      'unpublish_on[0][value][time]' => \Drupal::service('date.formatter')->format(REQUEST_TIME + 1800, 'custom', 'H:i:s'),
+      'publish_on[0][value][date]' => \Drupal::service('date.formatter')->format($request_time + 8100, 'custom', 'Y-m-d'),
+      'publish_on[0][value][time]' => \Drupal::service('date.formatter')->format($request_time + 8100, 'custom', 'H:i:s'),
+      'unpublish_on[0][value][date]' => \Drupal::service('date.formatter')->format($request_time + 1800, 'custom', 'Y-m-d'),
+      'unpublish_on[0][value][time]' => \Drupal::service('date.formatter')->format($request_time + 1800, 'custom', 'H:i:s'),
     ];
     $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, $checkbox ? 'Save' : 'Save and keep unpublished');
     $this->assertRaw(t("The 'unpublish on' date must be later than the 'publish on' date."), 'Validation prevents entering an unpublish-on date which is earlier than the publish-on date.');
