diff --git a/upload/system/framework.php b/upload/system/framework.php index 4e41df05..11aa4433 100644 --- a/upload/system/framework.php +++ b/upload/system/framework.php @@ -85,6 +85,13 @@ $db = new DB($config->get('db_type'), $config->get('db_hostname'), $config->get('db_username'), $config->get('db_password'), $config->get('db_database'), $config->get('db_port'), $config->get('db_ssl_key'), $config->get('db_ssl_cert'), $config->get('db_ssl_ca')); $registry->set('db', $db); + // Set time zone + $query = $db->query("SELECT * FROM " . DB_PREFIX . "setting WHERE `key` = 'config_timezone' AND store_id = '0'"); + + if ($query->num_rows) { + date_default_timezone_set($query->row['value']); + } + // Sync PHP and DB time zones $db->query("SET time_zone = '" . $db->escape(date('P')) . "'"); }