From 4d35063f317d2f571ca1e99cd4c73afb12ffe8ac Mon Sep 17 00:00:00 2001 From: Brad Bell Date: Mon, 26 Aug 2024 17:19:35 -0700 Subject: [PATCH 1/2] - Fixed a bug where `craft\helpers\Db::supportsTimeZones()` could return incorrect timezone information on some environments https://github.com/craftcms/cms/issues/15592 --- CHANGELOG.md | 4 ++++ src/helpers/Db.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f25fd7ba13d..fefde1c28ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Release Notes for Craft CMS 4 +## Unreleased + +- Fixed a bug where `craft\helpers\Db::supportsTimeZones()` could return incorrect timezone information on some environments. ([#15592](https://github.com/craftcms/cms/issues/15592)) + ## 4.11.5 - 2024-08-26 - Fixed a bug where it wasn’t possible to override named transforms in GraphQL queries. ([#15572](https://github.com/craftcms/cms/issues/15572)) diff --git a/src/helpers/Db.php b/src/helpers/Db.php index 2045cf16d0f..19b4abaf7f0 100644 --- a/src/helpers/Db.php +++ b/src/helpers/Db.php @@ -1470,7 +1470,7 @@ public static function supportsTimeZones(?Connection $db = null): bool return true; } - $result = $db->createCommand("SELECT CONVERT_TZ('2007-03-11 2:00:00','US/Eastern','US/Central') AS time1")->queryScalar(); + $result = $db->createCommand("SELECT CONVERT_TZ('2007-03-11 02:00:00','America/Los_Angeles','America/New_York') AS time1")->queryScalar(); return (bool)$result; } From 17303e4ef1081a839cb41e9377fed5bbfadc72d1 Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Tue, 27 Aug 2024 06:22:10 -0400 Subject: [PATCH 2/2] Release note tweak [ci skip] --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e321373028c..aecd9db096b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## Unreleased - Fixed a SQL error that occurred when running the `db/convert-charset` command if there were any custom database views or sequences. ([#15598](https://github.com/craftcms/cms/issues/15598)) -- Fixed a bug where `craft\helpers\Db::supportsTimeZones()` could return incorrect timezone information on some environments. ([#15592](https://github.com/craftcms/cms/issues/15592)) +- Fixed a bug where `craft\helpers\Db::supportsTimeZones()` could return `false` on databases that supported time zone conversion. ([#15592](https://github.com/craftcms/cms/issues/15592)) ## 4.11.5 - 2024-08-26