2 ms·
Hmm, some hard parts for automation left unsaid. > use that location to determine the correct timezone Does this mean consult an "address to timezone lookup s
by mixmastamyk 2y ago
Hmm, some hard parts for automation left unsaid.
> use that location to determine the correct timezone
Does this mean consult an "address to timezone lookup service?" Not sure if they exist, and I don't see another way without user specifying manually. Maybe a string match, but it could be wrong/unsure somewhat often.
> Then if Idaho decide to cancel daylight savings time you can update
Looking up events within a time interval is easy enough, those in city (timezone?) limits not so much. Consult a GIS system, search within polygons??? String match or every city in your database?
- simonw 2y agoThey do exist: many geocoding APIs (address to lat/lon) can optionally return a timezone as well, like this one: https://opencagedata.com/api#forward-resp https://opencagedata.com/api#forward-resp Or you can get a latitude/longitude and derive the timezone from that - I built an API for that here https://timezones.datasette.io/timezones/by_point?longitude=-116.23&latitude=43.61 https://timezones.datasette.io/timezones/by_point?longitude=...
- mixmastamyk 2y agoDanke. I wonder about making one's business dependent on such services however.
- simonw 2y agoIt's possible these days to run an entirely open source geocoding stack of your own. Here's one of the better options for that: https://github.com/osm-search/Nominatim https://github.com/osm-search/Nominatim I wouldn't recommend it though: it needs a beefy machine and applying updates on an ongoing basis is fiddly. Better to use a commercial option and have that as an escape hatch.