Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ability to set time offset with loading file + enhance spec for Local time #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

None yet

1 participant