From 17b37d58534c1577be6fdfccc3ad6168d11cc5e4 Mon Sep 17 00:00:00 2001 From: saturneric Date: Mon, 26 Feb 2024 19:55:50 +0800 Subject: fix: show the real UTC datetime --- src/core/utils/LocalizedUtils.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/core/utils/LocalizedUtils.cpp') diff --git a/src/core/utils/LocalizedUtils.cpp b/src/core/utils/LocalizedUtils.cpp index 6c020ed7..e5c9b434 100644 --- a/src/core/utils/LocalizedUtils.cpp +++ b/src/core/utils/LocalizedUtils.cpp @@ -32,7 +32,12 @@ namespace GpgFrontend { -auto GetFormatedDateByTimestamp(time_t timestamp) -> QString { +auto GetLocalizedDateByTimestamp(time_t timestamp) -> QString { return QLocale().toString(QDateTime::fromSecsSinceEpoch(timestamp)); } + +auto GetUTCDateByTimestamp(time_t timestamp) -> QString { + return QLocale().toString(QDateTime::fromSecsSinceEpoch(timestamp).toUTC()); +} + } // namespace GpgFrontend -- cgit v1.2.3