From 88ab45c41d05b68d26b57097d1822052d28b89a2 Mon Sep 17 00:00:00 2001 From: Pekka Vuorela Date: Wed, 2 Mar 2016 16:09:56 +0200 Subject: [PATCH] [transfer-engine] Store timestamps in proper ISO-8601 UTC. Contributes to JB#34413 ::toString() with time pattern can use localized numbers, which doesn't end up proper ISO-8601 format. Also as local time the value was ambigous after timezone change. --- src/dbmanager.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/dbmanager.cpp b/src/dbmanager.cpp index edb896a..1013f42 100644 --- a/src/dbmanager.cpp +++ b/src/dbmanager.cpp @@ -103,10 +103,8 @@ class DbManagerPrivate { QString currentDateTime() { - // TODO: Make sure this can handle time correctly - // Let's use ISO8601 strings - QDateTime dt = QDateTime::currentDateTime(); - return dt.toString("yyyy-MM-ddThh:mm:ss"); + QDateTime dt = QDateTime::currentDateTimeUtc(); + return dt.toString(Qt::ISODate); } bool createDatabaseSchema()