Skip to content

Conversation

@doc75
Copy link
Collaborator

@doc75 doc75 commented Sep 18, 2021

In the FIT File Types description, in FIT message activity we can find this description for local_timestamp

Timestamp epoch expressed in local time. Used to determine the time_zone or convert timestamps to local time

I have not found a way to do that dynamically during loading, so I am proposing this PR.
It allows to load the file to get the offset and then use this offset as an input to load the file again (too bad the file has to be loaded twice).
I am using this trick for quite a while and it allows to get the proper time on file created before the garmin watch time is set properly with antfs-cli in my case.

Do not hesitate to let me know if anything need to be changed (this time I checked the spec and rubocop results are fine ;-) )

I also modified a test related to local time to make it timezone independant while checking the date itself.
I hope it will work with all time zones (not really tested)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant