From 8f80129bac29227a03c35940af9d197ef0fa6398 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 22 May 2020 18:53:25 +0200 Subject: cleanup: create common QDateTime -> timestamp conversion function In analogy to the timestamp -> QDateTime conversion, create a common function. 1) For symmetry with the opposite conversion. 2) To remove numerous inconsistencies. 3) To remove use of the deprecated QDateTime::toTime_t() function. Signed-off-by: Berthold Stoeger --- mobile-widgets/qmlmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mobile-widgets/qmlmanager.cpp') diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 36394364b..82cc5309b 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -908,7 +908,7 @@ parsed: // add a hundred years. if (newDate.addYears(100) < QDateTime::currentDateTime().addYears(1)) newDate = newDate.addYears(100); - d->dc.when = d->when = newDate.toMSecsSinceEpoch() / 1000; + d->dc.when = d->when = dateTimeToTimestamp(newDate); return true; } appendTextToLog("none of our parsing attempts worked for the date string"); -- cgit v1.2.3-70-g09d2