X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fpostgresqlstorage.cpp;h=68cf25449d55a3f16d8d9362bb37a9c5b2eea15b;hb=7bdf962fa7c6fae511798d20109a86cd6edbffe0;hp=ca8657047590ce3c63033bed0854cbce391aa4bc;hpb=d82f98b8cf9c7c83f3aab1d7f010ccf8bdd2c003;p=quassel.git diff --git a/src/core/postgresqlstorage.cpp b/src/core/postgresqlstorage.cpp index ca865704..68cf2544 100644 --- a/src/core/postgresqlstorage.cpp +++ b/src/core/postgresqlstorage.cpp @@ -136,6 +136,14 @@ bool PostgreSqlStorage::initDbSession(QSqlDatabase &db) return false; break; } + + // Set the PostgreSQL session timezone to UTC, since we want timestamps stored in UTC + QSqlQuery tzQuery = db.exec("SET timezone = 'UTC'"); + if (tzQuery.lastError().isValid()) { + quError() << "Failed to set timezone to UTC!"; + return false; + } + return true; }