diff options
author | Salvador Cuñat <salvador.cunat@gmail.com> | 2017-01-22 14:08:43 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-02-10 20:30:58 -0800 |
commit | 8b2de77f912e1f75af3de7a23af63b14a71375b2 (patch) | |
tree | 600bd7f2db522606fb667538a0cf6a4d3822d5aa | |
parent | f7045c57cd94700d64ef4e18b4733c9d8cab1e79 (diff) | |
download | subsurface-8b2de77f912e1f75af3de7a23af63b14a71375b2.tar.gz |
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>
-rw-r--r-- | smtk-import/smartrak.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); |