Ref T308, using an optimized (faster) function for YYYYmmdd string parsing

Ref T309, found that QDateTime::fromString returns a QDateTime object with local timestamp. Using a optimized version returns UTC objects now.

- The bug was found writing a unit test for Ref T308
- Slack: https://swift-project.slack.com/archives/G7GD2UP9C/p1534848725000100
This commit is contained in:
Klaus Basan
2018-08-21 15:19:16 +02:00
parent d3c3fe2566
commit 183280fa75
13 changed files with 167 additions and 61 deletions

View File

@@ -247,7 +247,7 @@ namespace BlackMisc
// "2/1/2014 12:00:00 AM", "5/26/2014 2:00:00 PM"
const QString updated = attributes.namedItem("UpdatedOn").nodeValue();
QDateTime qt = QDateTime::fromString(updated, "M/d/yyyy h:mm:ss AP");
QDateTime qt = fromStringUtc(updated, "M/d/yyyy h:mm:ss AP");
qint64 updatedTimestamp = qt.toMSecsSinceEpoch();
int rulesSize = rules.size();