From a96e91ca749223950e4ae872ae14bfc469788c0a Mon Sep 17 00:00:00 2001 From: Philipp Spitzer Date: Wed, 2 May 2012 21:45:10 +0000 Subject: [PATCH] This at least partly fixes #42 ("fun with time zones"). --- src/orm/ormrecord.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/orm/ormrecord.h b/src/orm/ormrecord.h index 49c83c8..73541e2 100644 --- a/src/orm/ormrecord.h +++ b/src/orm/ormrecord.h @@ -215,7 +215,9 @@ QVariant OrmRecord::convertToDb(QVariant value, QVariant::Type colType) { if (colType == QVariant::DateTime && value.canConvert()) { - return value.toDateTime().toTime_t(); + QDateTime dateTime = value.toDateTime(); + dateTime.setTimeSpec(Qt::UTC); // this is to avoid that dateTime.toTime_t changes the time depending on the local time zone + return dateTime.toTime_t(); } return value; -- 2.39.5