From 8b2de77f912e1f75af3de7a23af63b14a71375b2 Mon Sep 17 00:00:00 2001 From: Salvador Cuñat Date: Sun, 22 Jan 2017 14:08:43 +0100 Subject: smtk-import-change mktime with timegm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There were 1 or 2 hour differences between real dive time and the imported time because of the time zones and energy saving in some locales. Using timegm() ensures us UTC times instead of localized times. Signed-off-by: Salvador Cuñat --- smtk-import/smartrak.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smtk-import/smartrak.c b/smtk-import/smartrak.c index 3fd8db6de..e5ae5c78d 100644 --- a/smtk-import/smartrak.c +++ b/smtk-import/smartrak.c @@ -767,7 +767,7 @@ void smartrak_import(const char *file, struct dive_table *divetable) /* Date issues with libdc parser - Take date time from mdb */ smtk_date_to_tm(col[coln(DATE)]->bind_ptr, tm_date); smtk_time_to_tm(col[coln(INTIME)]->bind_ptr, tm_date); - smtkdive->dc.when = smtkdive->when = mktime(tm_date); + smtkdive->dc.when = smtkdive->when = timegm(tm_date); free(tm_date); smtkdive->dc.surfacetime.seconds = smtk_time_to_secs(col[coln(INTVAL)]->bind_ptr); -- cgit v1.2.3-70-g09d2