diff --git a/core/modules/views/tests/src/Functional/Plugin/MonthDatePluginTest.php b/core/modules/views/tests/src/Functional/Plugin/MonthDatePluginTest.php index 2f6712432aa694263b5516edb1165714cc8313ab..3f3f2abfd2535af5d2c968e001fb699f5c33861d 100644 --- a/core/modules/views/tests/src/Functional/Plugin/MonthDatePluginTest.php +++ b/core/modules/views/tests/src/Functional/Plugin/MonthDatePluginTest.php @@ -50,10 +50,14 @@ class MonthDatePluginTest extends ViewTestBase { */ public function setUp($import_test_views = TRUE): void { parent::setUp($import_test_views); - $date1 = '2020-10-01 00:00:00'; - $this->node1 = $this->drupalCreateNode(['created' => strtotime($date1)]); - $date2 = '2020-11-01 00:00:00'; - $this->node2 = $this->drupalCreateNode(['created' => strtotime($date2)]); + $utc = new \DateTimeZone('UTC'); + $format = 'Y-m-d h:i:s'; + $this->node1 = $this->drupalCreateNode([ + 'created' => \DateTime::createFromFormat($format, '2020-10-01 00:00:00', $utc)->getTimestamp(), + ]); + $this->node2 = $this->drupalCreateNode([ + 'created' => \DateTime::createFromFormat($format, '2020-11-01 00:00:00', $utc)->getTimestamp(), + ]); } /**