pierremtb / easy-fit

Parse your .FIT files easily, directly from JS
Other
70 stars 51 forks source link

Incorrect constant used in FIT time to unix epoch time conversion #16

Closed srskc closed 6 years ago

srskc commented 6 years ago

easy-fit uses the following code to convert FIT time to unix epoch time:

case 'date_time': return new Date((data * 1000) + 631062000000);

When we read our FIT files, this turns out to be one hour wrong.

The constant 631065600000, as used in the following library, does work: https://github.com/dgaff/fitsdk/blob/master/java/com/garmin/fit/LocalDateTime.java

pierremtb commented 6 years ago

Mmh okay, it seems indeed wrong. Didn't use this library for a long time so I don't remember if the time was correct (definitely need to get back into it and improve it). Could you make a pull request?

srskc commented 6 years ago

@pierremtb Pull request sent. Will you be able to push a new version to npm so we don't need to maintain a workaround?

pierremtb commented 6 years ago

@srskc Sorry I forgot to answer. I'll merge the pull request and push to npm ASAP