summaryrefslogtreecommitdiffstats
path: root/core/qthelper.cpp
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2016-04-28 16:31:37 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-04-29 09:07:41 -0700
commit56ed3f1c6119b9ac86f602455d54318623640056 (patch)
tree0c342158ea4c2d2443139361deba786fa1b01bab /core/qthelper.cpp
parent84166a4ee77502bdb4a981bc5404a1a970c579cc (diff)
downloadsubsurface-56ed3f1c6119b9ac86f602455d54318623640056.tar.gz
Fix Qt date interfaces for times before 1970
This seems to work around the crazy QDateTime::fromTime_t() problem in Qt. It is *very* lightly tested. In fact, the only test is that "test0.xml" change that is part of this patch. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/qthelper.cpp')
-rw-r--r--core/qthelper.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/qthelper.cpp b/core/qthelper.cpp
index a261cca38..86c8816bc 100644
--- a/core/qthelper.cpp
+++ b/core/qthelper.cpp
@@ -950,7 +950,7 @@ QString get_trip_date_string(timestamp_t when, int nr, bool getday)
{
struct tm tm;
utc_mkdate(when, &tm);
- QDateTime localTime = QDateTime::fromTime_t(when);
+ QDateTime localTime = QDateTime::fromMSecsSinceEpoch(1000*when,Qt::UTC);
localTime.setTimeSpec(Qt::UTC);
QString ret ;