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

Time Zone data is wrong for some cities that abandoned DST #185

Open
WarpedPixel opened this issue Feb 17, 2021 · 3 comments
Open

Time Zone data is wrong for some cities that abandoned DST #185

WarpedPixel opened this issue Feb 17, 2021 · 3 comments
Assignees

Comments

@WarpedPixel
Copy link

The time zone request seems to be parsed correctly but the service is returning incorrect data (says there is DST but that is no longer true). The bug is in the service or the service request (I can't tell), not in the watch face code. Example:
Request:
https://script.google.com/macros/s/AKfycbwPas8x0JMVWRhLaraJSJUcTkdznRifXPDovVZh8mviaf8cTw/exec?city=Rio%20de%20Janeiro
Response:
{"requestCity":"Rio de Janeiro","city":"Rio de Janeiro","current":{"gmtOffset":-7200,"dst":true},"next":{"when":1613872800,"gmtOffset":-10800,"dst":false}}
Which is correctly parsed as GMT-2, but the correct time is GMT-3, and there are no upcoming DST time changes. See here: https://www.timeanddate.com/time/change/brazil/rio-de-janeiro

@WarpedPixel
Copy link
Author

Of course, current time is less than "when" in the query result in my previous comment.

I implemented a workaround: any city that ends in "*" will use the timezone for the city ignoring any DST information (will always pick the gmtOffset where DST is false, if any).

@warmsound
Copy link
Owner

@WarpedPixel thanks for reporting this. The service is based on a Google Sheet containing data from TimeZoneDB. I implemented this service, rather than using the TimeZoneDB API directly, either because I wanted more control over the data returned from the API call, or to avoid breaking their terms of service (I forget which). I didn't realise at the time, that time zone data can change surprisingly frequently: a colleague of mine works in Volgograd, where the time zone has changed twice since I implemented the service back in October 2018.

I'll assign myself this issue, and will try and get round to updating the Google Sheet shortly, and also check if there is a way, either directly from the watch, or indirectly via the existing service, to query the live TimeZoneDB API. Thanks!

@warmsound warmsound self-assigned this Feb 21, 2021
@2b2bff
Copy link
Contributor

2b2bff commented Jun 11, 2021

There is a good video on YouTube about developers and time zones and why you should rely on APIs instead of doing it yourself... ;)
https://www.youtube.com/watch?v=-5wpm-gesOY

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

3 participants