List of timezones as a drop menu

May 10, 2009
by David Mytton

If you want to support users in multiple timezones to display time sensitive data like we do in our server monitoring application, Server Density, then you need to be able to display a list of all the available timezones.

This can be difficult if you’re not simply doing a list of GMT+1, GMT+2, etc. If you do this then the user needs to change it when daylight savings time comes into effect and it’s not very user friendly for users who are unsure of their current timezone.

The route we took was to display a list of major cities on a per continent basis so the user can select the city nearest them and get the right date and time every time.

The code you need can be found here:

This can be used with the tutorial I wrote up about handling timezone conversion with PHP.

3 Responses leave one →
  1. May 25, 2009

    I think a better approach would be to come up with a list of user friendly names (similar to the windows designations for timezones), and map those to Olson TZIDs. I wrote about a how I did this on my blog if you want to check it out: http://www.aviblock.com/blog/2009/03/12/presenting-a-list-of-timezones-to-the-user/

    I also found a similarly laid out list on this site once too: http://vyew.com

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS