Skip to content
So you never again have to say “It’s 5 o’clock somewhere…”
JavaScript PHP HTML CSS
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets
.htaccess
5.php
README.md
favicon.ico
index.html

README.md

whereisitfiveoclock.beer

So you never again have to say “It’s 5 o’clock somewhere…”

If you dig it, consider tossing some 🍺💰 my way: venmo.com/segdeha

colophon

It was weirdly hard to answer the question, “where is it currently 5 o’clock?” I ended up cobbling together a solution using a couple of different data sources and a bit of scripting.

I start by calling the GET /list-time-zone endpoint on TimeZoneDB.com to get the current time in each time zone around the world.

I then loop through the results and pull out each time zone (America/Los_Angeles, Europe/Andorra, Antarctica/McMurdo, etc.) where the current hour is 17 (i.e. 5pm).

Next, I query a simple database consisting of 2 tables, one containing 24,297 cities with their associated time zones, the other that’s used to look up country names from country codes, the data for both coming from geonames.org.

Finally, I cache the JSON response I send back to the browser so it’s regenerated at most once every half hour.

Super simple, but it works! ¯\_(ツ)_/¯

The spinning globe was, um…borrowed from a blog post by Bjørn Sandvik.

You can’t perform that action at this time.