Use QDateTime::setOffsetFromUtc instead of QDateTime::setUtcOffset

This commit is contained in:
Roland Rossgotterer
2019-02-25 11:15:11 +01:00
committed by Mat Sutcliffe
parent 80cfb0e701
commit 3f9042848f
2 changed files with 3 additions and 3 deletions

View File

@@ -258,7 +258,7 @@ namespace BlackMisc
if (dateTimeString.isEmpty() || format.isEmpty()) { return QDateTime(); }
QDateTime dt = QDateTime::fromString(dateTimeString, format);
if (!dt.isValid()) { return dt; }
dt.setUtcOffset(0); // must only be applied to valid timestamps
dt.setOffsetFromUtc(0); // must only be applied to valid timestamps
return dt;
}
@@ -267,7 +267,7 @@ namespace BlackMisc
if (dateTimeString.isEmpty()) { return QDateTime(); }
QDateTime dt = QDateTime::fromString(dateTimeString, format);
if (!dt.isValid()) { return dt; }
dt.setUtcOffset(0); // must only be applied to valid timestamps
dt.setOffsetFromUtc(0); // must only be applied to valid timestamps
return dt;
}