* set correct time zone
* use RVO (MS review refs #561)
This commit is contained in:
Klaus Basan
2016-01-08 00:27:14 +01:00
parent f607b72821
commit 1ddf470a1d
2 changed files with 3 additions and 2 deletions

View File

@@ -46,8 +46,7 @@ namespace BlackMisc
QJsonValue IDatastoreObjectWithIntegerKey::getDbKeyAsJsonValue() const
{
if (this->hasValidDbKey()) { return QJsonValue(this->m_dbKey); }
static const QJsonValue null;
return null;
return QJsonValue();
}
void IDatastoreObjectWithIntegerKey::setKeyAndTimestampFromDatabaseJson(const QJsonObject &json, const QString &prefix)

View File

@@ -13,6 +13,7 @@
#include "blackmisc/stringutils.h"
#include <QJsonObject>
#include <QJsonDocument>
#include <QTimeZone>
using namespace BlackMisc;
using namespace BlackMisc::Simulation;
@@ -56,6 +57,7 @@ namespace BlackMisc
{
QString ts(timestamp.trimmed().remove(' ').remove('-').remove(':')); // normalize
QDateTime dt = QDateTime::fromString(ts, "yyyyMMddHHmmss");
dt.setTimeZone(QTimeZone::utc());
return dt;
}
else