Skip to content

Latest commit

 

History

History
55 lines (37 loc) · 2.8 KB

README.md

File metadata and controls

55 lines (37 loc) · 2.8 KB

This web page answers 2 simple questions:

  • Where is it going to be 4:20 PM next?
  • How soon?

Feel free to fork this if you prefer some other hour :)

Generating tz.js

The standard time zone db needs to be pre-processed in order to easily answer these seemingly simple questions.

For that, you should generate tz.js by running python mk420tz.py on the latest csv files (available here).

This should be done each time a time zone goes in or out of daylight saving time (DST). Best is to run this as a daily cron task.

Once in a while, the TZ database changes and you need to load fresh csv files. To be notified when this happens, you can follow @timezonedb on twitter, or use the atom feed.

Quick start for the lazy

For your convenience, if you want to start running this right away, tz-example.js contains some version of tz.js. Not necessarily the freshest, but no harm in running a slightly inaccurate version of this ;)

generating flickrplaces.js

Nomally, you don't have to do this, unless a future version of the timezone db introduces new places, or you want to change the format of the place names in tz.js (by tweaking mk420tz.py). If you're into it, here's how:

  1. Get a flickr API key.

  2. Copy conf-example.py to conf.py and edit it.

  3. Run python mkflickrplaces.py. Note that it takes about 15 minutes to run, because it waits 2 seconds between API requests, to avoid flooding the good folks at flickr.

  4. Edit flickrplaces.js and fix the following known bugs

    • "Costa Rica, CR": "/Italy/Lombardy" should be "/Costa+Rica"
    • "Malta, MT": "/United+States/Montana/Malta" should be "/Malta"
    • If you find other bugs there, please leave an issue here.

Thanks

Frequently Asked question

Seattle doesn't appear because it isn't on the timezone list :(


Deadlines are either dead or dying. Procrastination is for life.

Flattr this