Skip to content

Commit 7aa8baa

Browse files
committed
Add the Timezone Offset to Extra Info.
Add an 'Extra Info' field to show the timezone offset in seconds for dive computers that supply this information. Essentially a 'cut out the middleman' for subsurface/libdc#100. Signed-off-by: Michael Keller <github@ike.ch>
1 parent 80a41a9 commit 7aa8baa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

core/libdivecomputer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,11 @@ static dc_status_t libdc_header_parser(dc_parser_t *parser, device_data_t *devda
650650
tm.tm_min = dt.minute;
651651
tm.tm_sec = dt.second;
652652
dive->when = dive->dcs[0].when = utc_mktime(&tm);
653+
654+
if (dt.timezone) {
655+
std::string timezone_offset = format_string_std("%+d", dt.timezone);
656+
add_extra_data(&dive->dcs[0], "Time offset from UTC [s]", timezone_offset);
657+
}
653658
}
654659

655660
// Parse the divetime.

0 commit comments

Comments
 (0)