From 76087fcff3fd1a1258d685765ecd60ad86e6cd0c Mon Sep 17 00:00:00 2001
From: JediKev <kevin@enhancesoft.com>
Date: Tue, 12 Nov 2019 13:47:01 -0600
Subject: [PATCH] db: System Time Zone

This addresses issue 5156 where using something like AWS RDS shows incorrect
timezone for the database. In systems like AWS RDS you cannot set the
`@@global.system_time_zone` variable to anything other than `UTC` which is a
problem. This updates `db_connect` to set the session timezone to the global
timezone for every connection. This will ensure the appropriate timezone is
used in subsequent methods.
---
 include/mysqli.php | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/mysqli.php b/include/mysqli.php
index efb459f33..3d51be1f3 100644
--- a/include/mysqli.php
+++ b/include/mysqli.php
@@ -74,6 +74,7 @@ function db_connect($host, $user, $passwd, $options = array()) {
         'CHARACTER SET'         => 'utf8',
         'COLLATION_CONNECTION'  => 'utf8_general_ci',
         'SQL_MODE'              => '',
+        'TIME_ZONE'             => '@@global.time_zone',
     ), 'session');
     $__db->set_charset('utf8');
 
-- 
GitLab