Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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?



They 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

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=...


Danke. I wonder about making one's business dependent on such services however.


It'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

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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: