diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2020-11-11 14:27:10 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2020-11-12 11:02:27 +0100 |
commit | f8f0eff273ba832f8b8ae8b27d4d3cf7a2d2efb7 (patch) | |
tree | 041c0af6961a33d5fa841055101d905bf0e369ce /src | |
parent | bf547fb272f568e438ed9c2fe48427b5a054f93a (diff) |
Use QDate::startOfDay() rather than QDateTime(,QTime(0, 0),)
Makes no difference in this case, as it's UTC, but is terser and
perhaps slightly clearer.
Change-Id: I7de315def2f45ec4a12d2a682e5d1d7a4d0a3e6d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/jsruntime/qv4dateobject.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4dateobject.cpp b/src/qml/jsruntime/qv4dateobject.cpp index 19ae62f054..a4d3c8ca30 100644 --- a/src/qml/jsruntime/qv4dateobject.cpp +++ b/src/qml/jsruntime/qv4dateobject.cpp @@ -637,9 +637,8 @@ static inline double ParseString(const QString &s, double localTZA) for (const QString &format : formats) { dt = format.indexOf(QLatin1String("hh:mm")) < 0 - ? QDateTime(QDate::fromString(s, format), - QTime(0, 0, 0), Qt::UTC) - : QDateTime::fromString(s, format); // as local time + ? QDate::fromString(s, format).startOfDay(Qt::UTC) + : QDateTime::fromString(s, format); // as local time if (dt.isValid()) break; } |