aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4dateobject.cpp
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2022-04-29 17:09:51 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2022-05-02 17:25:11 +0200
commit1e75b182dba05bfe3af14ed610b315165641ff30 (patch)
treedca1cff5ba95a25802e5b7c7f67609caf88c6f9b /src/qml/jsruntime/qv4dateobject.cpp
parentb181c4d98891b4ad7bab44964e0d3ad97f3b29a9 (diff)
Simplify ToDateTime() and fix a typo in its doc
The QDateTime::fromMSecsSinceEpoch(t, Qt::UTC).toTimeSpec(spec) call is in fact equivalent to QDateTime::fromMSecsSinceEpoch(t, spec), I just got confused when I last changed it ! The \tt in the doc comment should simply have been \a t. Change-Id: I460e4105bfa981fd5e44fb57d447fb035f0a4781 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4dateobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4dateobject.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4dateobject.cpp b/src/qml/jsruntime/qv4dateobject.cpp
index ebe0fd19df..d366f5909a 100644
--- a/src/qml/jsruntime/qv4dateobject.cpp
+++ b/src/qml/jsruntime/qv4dateobject.cpp
@@ -671,14 +671,14 @@ static inline double ParseString(const QString &s, double localTZA)
/*!
\internal
- Converts the ECMA Date value \tt (in UTC form) to QDateTime
+ Converts the ECMA Date value \a t (in UTC form) to QDateTime
according to \a spec.
*/
static inline QDateTime ToDateTime(double t, Qt::TimeSpec spec)
{
if (std::isnan(t))
return QDateTime();
- return QDateTime::fromMSecsSinceEpoch(t, Qt::UTC).toTimeSpec(spec);
+ return QDateTime::fromMSecsSinceEpoch(t, spec);
}
static inline QString ToString(double t, double localTZA)