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

GPSTimestamp::getTime() has time shift in the opposite direction of the system time wrt UTC #6

Open
hicklin opened this issue Oct 9, 2018 · 1 comment

Comments

@hicklin
Copy link

hicklin commented Oct 9, 2018

The mktime function used to convert the tm struct to time_t (seconds since Jan 1, 1970) assumes that the tm struct time is in local time. Hence, in the instance that the system time is not equal to UTC, the GPS time returned is shifted by the timezone in the opposite direction.

@hicklin
Copy link
Author

hicklin commented Oct 9, 2018

I have fixed the issue in my fork by subtracting the timezone in seconds from the returned time_t in line 175 of GPSFix.cpp.

return mktime(&t) - timezone;

@ckgt ckgt changed the title GPSTimestamp::getTime() has time shit in the opposite direction of the system time wrt UTC GPSTimestamp::getTime() has time shift in the opposite direction of the system time wrt UTC Nov 20, 2018
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

No branches or pull requests

1 participant