mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
84166a4ee7
commit
56ed3f1c61
4 changed files with 13 additions and 14 deletions
|
|
@ -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 ;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue