Lars Pind

internet software, coaching, and entrepreneurship

Lars Pind - internet software, coaching, and entrepreneurship
Check out Coach TV, my video blog on happiness and personal development for geeks.

Time zone by country

August 09, 2006 · 4 comments

Time Zone by Country.png Google Analytics is the first web app I’ve seen that does time zone by country.

It’s easier to navigate than a long list of time zones. And it lets you use the keyboard more easily, because you can type the first letter of your country name to select. In a select box where all entries start with “(GMT …”, the keyboard isn’t much help.

blog comments powered by Disqus

4 responses so far ↓

  • 1 Thomas // Aug 09, 2006 at 12:53 PM

    we've been doing something similar with 23, http://23hq.com for some. automatically setting the timezone based on country selection and if there are several time zones in the country display those possibilities.
  • 2 Lars Pind // Aug 09, 2006 at 01:07 PM

    Neat, I hadn't noticed because I'm in a country with just one time zone.
  • 3 Mark Aufflick // Aug 10, 2006 at 08:59 AM

    Google analytics does the same - offers a dropdown for the timezone when your country (like mine) has more than one. They even get Central time right (it's on a half hour boundary which is very unusual). At last, US companies start to get timezones! I wonder if it handles daylight savings properly (did you know some locations have more than 1 hour daylight savings?).
  • 4 Steffen // Aug 21, 2006 at 09:58 PM

    I'm happy that Thomas did put the record straight, but I though I might contribute some details about the way we do timezones. First, we stole some data from somewhere. Sadly, I can't remember the source. Then we search-replace'd it to a decent javascript data set: http://www.23hq.com/resources/um-style/timezones.js After including this, it's simple a matter of letting the user choose his country a then rebuild another <select> box with the applicable timezones: $('country').onchange = function() { var country = this[this.selectedIndex].value; var tzObj = this.parentNode.timezone; // Clear children while (tzObj.lastChild) tzObj.removeChild(tzObj.lastChild) if (tz[country]) { foreach (i in tz[country]) { var option = document.createElement('option'); option.value = tz[country][i]; option.appendChild(document.createTextNode(tz[country][i])); tzObj.appendChild(option); } } } (I haven't tested the code, but look at the slightly more complicated source at http://www.23hq.com/23/signup if it doesn't do the job correctly...) Also, Thomas wanted me to include a usability tip: If there's only one applicable timezone for the user's country (which is very often the case, of course) there's no need to actually show the timezeone select box.