World clock, 2008 edition 25 August 08

Almost exactly five years ago, I put together a world clock: original article.

I’ve toyed with this every so often since then, but the method I used to calculate local times was very crude, effectively switching the server’s location setting to each city in turn; this worked fine on my own local server but wasn’t suitable for shared webhosting.

I’ve now rewritten the clock from scratch in Perl, using the DateTime modules by Dave Rolsky and others, so it automatically adjusts for Daylight Saving Time (DST) changes. It’s robust enough to go live, but is still only a proof of concept – there’s no way to add cities (the set shown are based on colleagues’ working locations and home cities).

Click here for the world clock