Skip to content

Commit

Permalink
Merge pull request #15601 from craftcms/bugfix/15592
Browse files Browse the repository at this point in the history
Fixed a bug where `craft\helpers\Db::supportsTimeZones()` could return incorrect timezone information on some environments
  • Loading branch information
brandonkelly authored Aug 27, 2024
2 parents 6ca1e45 + 17303e4 commit 8af51bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +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 `false` on databases that supported time zone conversion. ([#15592](https://github.com/craftcms/cms/issues/15592))

## 4.11.5 - 2024-08-26

Expand Down
2 changes: 1 addition & 1 deletion src/helpers/Db.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 8af51bf

Please sign in to comment.