[HN Gopher] Show HN: A Simple Server to Match Long/Lat to a Time...
___________________________________________________________________
Show HN: A Simple Server to Match Long/Lat to a TimeZone
I figured this might be useful to folks. It's a simple PHP server
that requires a single-table database (It's fairly "agnostic," but
all my uses are in MySQL). I won't publish any of the servers that
I've set up for my apps, because someone is bound to write an
application that drives my bandwidth into the stratosphere. I
could definitely take it further, but this gives me all I need for
my purposes. Here's an app I wrote, that uses it:
https://apps.apple.com/us/app/we-are-never-alone/id650482602...
Author : ChrisMarshallNY
Score : 14 points
Date : 2025-05-20 21:43 UTC (1 hours ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| cyberax wrote:
| Super nice! I wanted to do an Arduino-based GPS clock that always
| shows the correct local time, but got bogged down getting the
| exact timezone boundaries.
|
| Thanks for bringing up https://github.com/evansiroky/timezone-
| boundary-builder !
| ChrisMarshallNY wrote:
| It's a great project. If you are involved, you have my thanks
| (also, the thanks of a lot of people that have no idea it
| exists).
| kevmo314 wrote:
| Since the geojson for the timezone data is a static file you can
| avoid using a database entirely and ship it to your app.
|
| If you'd like to avoid shipping a giant geojson, with the
| generosity of CDN providers you can actually hit the npm-hosting
| servers with HTTP Range requests and do this completely on demand
| from the client: https://github.com/kevmo314/browser-geo-tz
| edoceo wrote:
| How should we get right bits by range? Wouldn't we get chunks
| of JSON that aren't delimited nicely?
| akhenakh wrote:
| Look at this library embedding the TZ data, implemented in
| multiple languages, even providing an HTTP server
| https://github.com/ringsaturn/tzf
| SahAssar wrote:
| I'm guessing this does not try to handle things like terra
| nullius (Bir Tawil, Marie Byrd Land, etc.) or where there might
| not be a "correct" answer over which timezone is in a place (like
| https://www.972mag.com/the-worlds-only-ethnic-time-zone/)?
| ChrisMarshallNY wrote:
| It just uses the map that was generated by the TimeZone
| Boundary Builder[0]. It does fine for my purposes.
|
| I just figured it might be useful. One reason that I wrote it,
| was because I couldn't find a decent SaaS that didn't charge
| eye-watering prices, for a fairly slow response. I wrote it in
| an afternoon or two. Not really an ambitious project.
|
| I don't usually do "Show HN." Not interested in competing with
| anyone. If you like it, use it. If you don't like it, don't use
| it. If there are clear bugs, I'm always open to feedback.
|
| [0] https://github.com/evansiroky/timezone-boundary-builder
| OsrsNeedsf2P wrote:
| I recently had this issue with an Android app I made, it was
| surprisingly difficult to resolve. I ended up going with some
| OpenStreetMap mirror endpoint for my solution
___________________________________________________________________
(page generated 2025-05-20 23:00 UTC)