Garmin: Report correct local time offset #69
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We stupidly thought that the local time offset was in the "DEVICE_SETTINGS" message as the time_offset field. I'm pretty sure I've seen something like that before.
But the FIT files from github issue #4401 clearly have that time offset field being zero, and there are two other ways to figure out what local time actually is, namely in the "local_time" field of the ACTIVITY message or the TIMESTAMP_CORRELATION message.
Either of those seem to work for what we want, so let's parse both (we already did the ACTIVITY case), and let's ignore the "time_offset" field from DEVICE_SETTINGS at least if it is zero.
There is probably some real explanation for what the proper way to deal with all this is, and what the whole time_offset and utc_offset fields from DEVICE_SETTINGS means, and maybe we can improve on this in the future if somebody figures it all out.
In the meantime, this seems to be an improvement.
Reported-by: @WetsuitSeasoning
Link: subsurface/subsurface#4401