From 66ee4729d2a8a55b0fda7925837b17f2da2a561c Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Mon, 30 Sep 2024 04:06:57 +0200 Subject: [PATCH] qt: Specify utc as the dates' timezone Otherwise it loads all the dates as if they were in the local timezone, making it all a bit more complex for no reason. --- qt/release.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qt/release.cpp b/qt/release.cpp index f4730547..ce19baf8 100644 --- a/qt/release.cpp +++ b/qt/release.cpp @@ -24,6 +24,7 @@ #include #include +#include #include using namespace AppStream; @@ -95,13 +96,13 @@ QString Release::version() const QDateTime Release::timestamp() const { const guint64 timestamp = as_release_get_timestamp(d->m_release); - return timestamp > 0 ? QDateTime::fromSecsSinceEpoch(timestamp) : QDateTime(); + return timestamp > 0 ? QDateTime::fromSecsSinceEpoch(timestamp, QTimeZone::utc()) : QDateTime(); } QDateTime Release::timestampEol() const { const guint64 timestamp = as_release_get_timestamp_eol(d->m_release); - return timestamp > 0 ? QDateTime::fromSecsSinceEpoch(timestamp) : QDateTime(); + return timestamp > 0 ? QDateTime::fromSecsSinceEpoch(timestamp, QTimeZone::utc()) : QDateTime(); } QString Release::description() const