From baff33de5955aa54c859172bc70fc30343a2ec62 Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Thu, 6 Feb 2025 17:45:15 +0000 Subject: [PATCH] Ensure GraphQL always returns dates in UTC. --- tests/Feature/GraphQL/Fieldtypes/DateFieldtypeTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/Feature/GraphQL/Fieldtypes/DateFieldtypeTest.php b/tests/Feature/GraphQL/Fieldtypes/DateFieldtypeTest.php index 4cf18632ce..3d7ecec208 100644 --- a/tests/Feature/GraphQL/Fieldtypes/DateFieldtypeTest.php +++ b/tests/Feature/GraphQL/Fieldtypes/DateFieldtypeTest.php @@ -21,6 +21,10 @@ public function setUp(): void #[Test] public function it_gets_dates() { + // Set the timezone. We want to ensure the date is always returned in UTC. + config()->set('app.timezone', 'America/New_York'); // -05:00 + date_default_timezone_set('America/New_York'); + // Set the to string format so can see it uses that rather than a coincidence. // But reset it afterwards. $originalFormat = Carbon::getToStringFormat();