smtk-import-change mktime with timegm

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 <salvador.cunat@gmail.com>
This commit is contained in:
Salvador Cuñat 2017-01-22 14:08:43 +01:00 committed by Dirk Hohndel
parent f7045c57cd
commit 8b2de77f91

View file

@ -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);