From 1f605940b7058f490539396319e4bce8126b0eb7 Mon Sep 17 00:00:00 2001 From: Kevin Hendricks Date: Thu, 24 Oct 2024 22:36:32 -0400 Subject: [PATCH] manually revert PR #779 as QTimeZone does not create the correct dcterms::modified format --- src/Dialogs/MetaEditor.cpp | 3 +-- src/ResourceObjects/OPFResource.cpp | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Dialogs/MetaEditor.cpp b/src/Dialogs/MetaEditor.cpp index 9cc2921ae6..23101673e6 100644 --- a/src/Dialogs/MetaEditor.cpp +++ b/src/Dialogs/MetaEditor.cpp @@ -31,7 +31,6 @@ #include #include #include -#include #include "Dialogs/TreeModel.h" #include "Dialogs/TreeItem.h" @@ -475,7 +474,7 @@ void MetaEditor::selectElement() insertRow(EName(code), code, content, ""); } else if (code == "dcterms:modified") { QDateTime zt(QDateTime::currentDateTime()); - zt.setTimeZone(QTimeZone::utc()); + zt.setTimeSpec(Qt::UTC); QString content = zt.toString(Qt::ISODate); insertRow(EName(code), code, content, ""); } else if (code == "dc:type") { diff --git a/src/ResourceObjects/OPFResource.cpp b/src/ResourceObjects/OPFResource.cpp index f447f388b7..cd24604dbe 100644 --- a/src/ResourceObjects/OPFResource.cpp +++ b/src/ResourceObjects/OPFResource.cpp @@ -32,7 +32,6 @@ #include #include #include -#include #include "BookManipulation/CleanSource.h" #include "BookManipulation/XhtmlDoc.h" @@ -1501,7 +1500,7 @@ QString OPFResource::AddModificationDateMeta() { QString datetime; QDateTime local(QDateTime::currentDateTime()); - local.setTimeZone(QTimeZone::utc()); + local.setTimeSpec(Qt::UTC); datetime = local.toString(Qt::ISODate); QWriteLocker locker(&GetLock()); @@ -1577,7 +1576,7 @@ QString OPFResource::GetOPFDefaultText(const QString &version) } // epub 3 set dcterms:modified date time in ISO 8601 format QDateTime local(QDateTime::currentDateTime()); - local.setTimeZone(QTimeZone::utc()); + local.setTimeSpec(Qt::UTC); QString datetime = local.toString(Qt::ISODate); return TEMPLATE3_TEXT.arg(Utility::CreateUUID()).arg(defaultLanguage).arg(tr("[Main title here]")).arg(datetime); }