Fix wrong timestamps by setting the TZ variable from system time zone and with a fix from SDK (Event creation time that should comes from SOCI).

This commit is contained in:
Julien Wadel 2022-10-03 11:40:41 +02:00
parent 6ae6994a5f
commit c0621a1bf9
2 changed files with 14 additions and 1 deletions

View file

@ -21,6 +21,8 @@
#ifdef Q_OS_WIN
#include <QSettings>
#include <stdlib.h>
#include <time.h>
#endif // ifdef Q_OS_WIN
#include <QCommandLineParser>
#include <QDir>
@ -198,6 +200,17 @@ App::App (int &argc, char *argv[]) : SingleApplication(argc, argv, true, Mode::U
setWindowIcon(QIcon(Constants::WindowIconPath));
char * tz = getenv("TZ");
if(!tz){// If not set, set the environement variable for uses of mktime from the SDK.
#ifdef Q_OS_WIN
_putenv(("TZ="+QTimeZone::systemTimeZoneId().toStdString()).c_str());
_tzset();
#else
setenv("TZ", QTimeZone::systemTimeZoneId().toStdString().c_str(), 1);
tzset();
#endif
}
createParser();
mParser->process(*this);

@ -1 +1 @@
Subproject commit 94f3bbb6f08362f004919aa67d1693c275492129
Subproject commit 3d12b0566b28082bedf77ca54d7547536cc633fc