diff options
Diffstat (limited to 'modules/extra/mysql.cpp')
-rw-r--r-- | modules/extra/mysql.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/extra/mysql.cpp b/modules/extra/mysql.cpp index 1f6777bcc..294ddfac0 100644 --- a/modules/extra/mysql.cpp +++ b/modules/extra/mysql.cpp @@ -631,6 +631,10 @@ void MySQLService::Connect() if (!connect) throw SQL::Exception("Unable to connect to MySQL service " + this->name + ": " + mysql_error(this->sql)); + // We force UTC so that FromUnixtime works as expected. + SQL::Query tzquery("SET time_zone = '+00:00'"); + RunQuery(tzquery); + if (this->socket.empty()) Log(LOG_DEBUG) << "Successfully connected to MySQL service " << this->name << " at " << this->server << ":" << this->port; else |