mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
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:
parent
f7045c57cd
commit
8b2de77f91
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue