Skip to content

Commit

Permalink
manually revert PR #779 as QTimeZone does not create the correct dcte…
Browse files Browse the repository at this point in the history
…rms::modified format
  • Loading branch information
kevinhendricks committed Oct 25, 2024
1 parent e2376e2 commit 1f60594
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/Dialogs/MetaEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include <QInputDialog>
#include <QTimer>
#include <QDebug>
#include <QTimeZone>

#include "Dialogs/TreeModel.h"
#include "Dialogs/TreeItem.h"
Expand Down Expand Up @@ -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") {
Expand Down
5 changes: 2 additions & 3 deletions src/ResourceObjects/OPFResource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <QRegularExpressionMatch>
#include <QDateTime>
#include <QDebug>
#include <QTimeZone>

#include "BookManipulation/CleanSource.h"
#include "BookManipulation/XhtmlDoc.h"
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 1f60594

Please sign in to comment.