From 76946f2c436b084d65ee891f977b5b2c0c28c84b Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Fri, 10 Jan 2025 10:05:33 +0100 Subject: [PATCH] Fixes: #5. Sqlite stores date time in UTC --- lib/blockmodel.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/blockmodel.cpp b/lib/blockmodel.cpp index d53cd22..eaa2313 100644 --- a/lib/blockmodel.cpp +++ b/lib/blockmodel.cpp @@ -108,6 +108,8 @@ void BlockModel::loadAll() { QString name = query.value(1).toString(); QString note = query.value(2).toString(); QDateTime lastSeen = query.value(3).toDateTime(); + lastSeen.setTimeSpec(Qt::UTC); + lastSeen = lastSeen.toLocalTime(); bool blocked = query.value(4).toBool(); int count = query.value(5).toInt(); m_blocks.append(BlockItem(number, name, note, lastSeen, blocked, count));