diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2015-05-17 07:32:12 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-05-17 13:39:26 -0700 |
commit | 21d1903656f75cfd804608c16e257200efce8343 (patch) | |
tree | 3de29515a12d50bf8e00d453cb4ae0aaadd1f7cd /parse-xml.c | |
parent | 2dd5781afe19fa70d702eccd4462a4249cc4b1a8 (diff) | |
download | subsurface-21d1903656f75cfd804608c16e257200efce8343.tar.gz |
Correct dive time in DLF import
Divesoft Freedom records the dive time in count of seconds since
1.1.2000 00:00:00, not noon.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'parse-xml.c')
-rw-r--r-- | parse-xml.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/parse-xml.c b/parse-xml.c index 9f748cd9d..6894ec02b 100644 --- a/parse-xml.c +++ b/parse-xml.c @@ -2815,8 +2815,8 @@ int parse_dlf_buffer(unsigned char *buffer, size_t size) // (ptr[7] << 8) + ptr[6] Is "Serial" snprintf(serial, sizeof(serial), "%d", (ptr[7] << 8) + ptr[6]); cur_dc->serial = strdup(serial); - // Dive start time in seconds since 2000-01-01 12:00 UTC +0 - cur_dc->when = (ptr[11] << 24) + (ptr[10] << 16) + (ptr[9] << 8) + ptr[8] + 946728000; + // Dive start time in seconds since 2000-01-01 00:00 + cur_dc->when = (ptr[11] << 24) + (ptr[10] << 16) + (ptr[9] << 8) + ptr[8] + 946684800; cur_dive->when = cur_dc->when; cur_dc->duration.seconds = ((ptr[14] & 0xFE) << 16) + (ptr[13] << 8) + ptr[12]; |