Skip to content

Commit

Permalink
qt: Specify utc as the dates' timezone
Browse files Browse the repository at this point in the history
Otherwise it loads all the dates as if they were in the local timezone,
making it all a bit more complex for no reason.
  • Loading branch information
aleixpol authored and ximion committed Oct 6, 2024
1 parent 3203d61 commit 66ee472
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions qt/release.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include <QDateTime>
#include <QDebug>
#include <QTimeZone>
#include <QUrl>

using namespace AppStream;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 66ee472

Please sign in to comment.