diff options
author | mvglasow <michael -at- vonglasow.com> | 2018-07-22 20:13:18 +0200 |
---|---|---|
committer | mvglasow <michael -at- vonglasow.com> | 2018-07-22 20:13:18 +0200 |
commit | 4d9427c733bb5e71a0d41e1cc5ac2887911ed9d9 (patch) | |
tree | 3741c2ea7854b31774643e7f1bec2b09f9e0da1a /navit/util.c | |
parent | 5e27d6baf1fe1c3b4824a41abd2fe1d1cc055452 (diff) | |
download | navit-4d9427c733bb5e71a0d41e1cc5ac2887911ed9d9.tar.gz |
Fix:core:Fix DST-related error in mkgmtime()
Signed-off-by: mvglasow <michael -at- vonglasow.com>
Diffstat (limited to 'navit/util.c')
-rw-r--r-- | navit/util.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/navit/util.c b/navit/util.c index 11d6b21ce..379adbf6c 100644 --- a/navit/util.c +++ b/navit/util.c @@ -532,12 +532,12 @@ time_t mkgmtime(struct tm * pt) { pgt = g_memdup(gmtime(&ret), sizeof(struct tm)); plt = g_memdup(localtime(&ret), sizeof(struct tm)); - pti->tm_year -= pgt->tm_year - plt->tm_year; - pti->tm_mon -= pgt->tm_mon - plt->tm_mon; - pti->tm_mday -= pgt->tm_mday - plt->tm_mday; - pti->tm_hour -= pgt->tm_hour - plt->tm_hour; - pti->tm_min -= pgt->tm_min - plt->tm_min; - pti->tm_sec -= pgt->tm_sec - plt->tm_sec; + pti->tm_year = pt->tm_year - pgt->tm_year + plt->tm_year; + pti->tm_mon = pt->tm_mon - pgt->tm_mon + plt->tm_mon; + pti->tm_mday = pt->tm_mday - pgt->tm_mday + plt->tm_mday; + pti->tm_hour = pt->tm_hour - pgt->tm_hour + plt->tm_hour; + pti->tm_min = pt->tm_min - pgt->tm_min + plt->tm_min; + pti->tm_sec = pt->tm_sec - pgt->tm_sec + plt->tm_sec; ret = mktime(pti); |