<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Aviblock.com &#187; usability</title>
	<atom:link href="http://www.aviblock.com/blog/tag/usability/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.aviblock.com/blog</link>
	<description>My musings on web development</description>
	<lastBuildDate>Mon, 30 May 2011 15:07:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Presenting a list of Timezones to the user</title>
		<link>http://www.aviblock.com/blog/2009/03/12/presenting-a-list-of-timezones-to-the-user/</link>
		<comments>http://www.aviblock.com/blog/2009/03/12/presenting-a-list-of-timezones-to-the-user/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 20:41:18 +0000</pubDate>
		<dc:creator>Avi</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Expression Engine]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[timezones]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://www.aviblock.com/blog/?p=3</guid>
		<description><![CDATA[  I first got into timezones when I working on an calendar app which displayed various times of day which are pertinent to Jewish daily life. The app would display calculated times which of course would differ based on the timezone of the given location. As I investigated into timezones, I found them to be [...]]]></description>
			<content:encoded><![CDATA[<p> </p>
<p>I first got into timezones when I working on an <a title="OU Calendar Application" href="http://www.ou.org/holidays/calendar" target="_blank">calendar app</a> which displayed various times of day which are pertinent to Jewish daily life. The app would display calculated times which of course would differ based on the timezone of the given location. As I investigated into timezones, I found them to be fairly complicated. Not all timezones are even on the hour&#8230;some are at 30 minute offsets, some at 45 minutes, and historically there have been even stranger offsets than that.</p>
<p>To make matters worse, there&#8217;s the whole issue of Daylight Saving Time. Apparently some places have it some don&#8217;t. Some countries have a set date for DST, some pick a new one each year depending on circumstances. And of course, DST does not mean only adding one hour. <br />
<span id="more-3"></span><br />
My research led me to what is &#8220;colloquially&#8221; known as the <a title="Olson Database" href="http://www.twinsun.com/tz/tz-link.htm" target="_blank">&#8220;Olson&#8221; database</a>. The Olson database is a <a href="http://article.gmane.org/gmane.comp.time.tz/2496" target="_blank">de facto standard</a> in the world of keeping time. The most recognizable part of the way timezones are identified is the {Continent}/{Location} signature. For example, the timezone that I am in is called &#8220;America/New_York&#8221;. The Olson database tracks all historical information about timezones back at least until 1970. By timezone information, this also means transitions for DST and the GMT offset for both standard time and DST.</p>
<p>The best part of all of this, is that PHP 5 and up has <a title="PHP Support's Timezones" href="http://www.php.net/timezones " target="_blank">built in support</a> for understanding Olson timezones. This means that you all you need is the timezone id (the tzid), and you can have PHP worry about all the timezone and DST calculations.</p>
<p>Recently, I was working on another app which required members to select a timezone. The app is written on top of <a title="Expression Engine" href="http://www.expressionengine.com" target="_blank">Expression Engine</a> which contains a full blown membership system. The membership system includes a timezone setting. Let&#8217;s take a quick look at the what this look like:</p>
<div id="attachment_9" class="wp-caption alignnone" style="width: 1034px"><img class="size-large wp-image-9" title="Screenshot of timezone selection from Expression Engine" src="http://www.aviblock.com/blog/wp-content/uploads/2009/03/ss121-1024x350.png" alt="Selecting a timezone in Expression Engine" width="1024" height="350" /><p class="wp-caption-text">Selecting a timezone in Expression Engine</p></div>
<p>Notice the checkbox that says &#8220;Daylight Saving Time&#8221;? This means that the user has to remember, every year, to select that checkbox when DST happens. Not very fun. Expression Engine is written in PHP 4, and the authors <a title="Expression Engine to stay supporting PHP4" href="http://expressionengine.com/blog/entry/i_see_dead_server_side_scripting_languages/" target="_blank">intend to keep that</a>, stubbornly, for as long as possible.</p>
<p>I&#8217;m not here to wrant on Expression Engine (that&#8217;s for another time), but either way, this would not suit my purposes. I can&#8217;t rely on users remembering to &#8220;spring forward&#8221; when they have to.</p>
<p>The alternative is to provide a list based on the Olson database. The problem is that, as of this post, their are 560 tzid&#8217;s in the database, and they are not &#8220;friendly&#8221; nor recognizable to anybody but geeks. </p>
<p>I started looking around on the Interwebs trying to see what other people came up with. There was a <a href="http://stackoverflow.com/questions/119672/how-would-you-organize-a-timezone-dropdown" target="_blank">question</a> on <a title="stackoverflow.com" href="http://www.stackoverflow.com" target="_blank">Stackoverflow.com</a> which hit the nail on the head, but anybody answering the question missed the point completely.</p>
<p>Eventually I realized that I must present a list similar to Expression Engine&#8217;s list, but which has the values as Olson tzid&#8217;s. The first step was to clean up the list a little. Much of the information is redundant, and only there for historical purposes. For instance, until 2006, much of <a href="http://www.mccsc.edu/time.html" target="_blank">Indiana did not observe DST.</a> After 2006, however, the story changed. This explains why there are so many Olson tzid&#8217;s with Indiana in them. However, for all practical purposes, they&#8217;re the same.</p>
<p>The question is, what defines them as the same? I determined the best way would be to look at the DST transition date (if applicable), and the resulting offsets and compare them. Fortunately, PHP has a function that does this&#8230;<a href="http://us.php.net/manual/en/function.timezone-transitions-get.php" target="_blank">timezone_transitions_get()</a>.</p>
<p>My idea was to pull in all the timezones and their transistions into excel and sort them by offset, and transition dates to identify which tzids are similar. After that, to figure out a friendly name to call them.</p>
<p>Doing more research I found somebody made a <a title="spreadsheet for timezones" href="http://www.timdavis.com.au/data/olson-time-zone-database-to-standard-windows-time-zone-v01/ " target="_blank">spreadsheet</a> which tried to map Windows timezone names to Olson tzid&#8217;s. I used this a base reference for the names I chose, although I found not all the data in that spreadsheet was accurate (one day I will submit my changes to the author). Some timezones I had to come up with my own names like &#8220;America/Havana&#8221; which has different rules for any place in its timezone. I decided to call this (GMT-05:00) Cuba for lack of anything else.</p>
<p>In the end, I came up with a list of about 80 or so timezones, and I&#8217;m somewhat proud of my results:</p>
<p>Here is the list:</p>
<pre lang="HTML">
<option value="Pacific/Midway">(GMT-11:00) Midway Island, Samoa</option>
<option value="America/Adak">(GMT-10:00) Hawaii-Aleutian</option>
<option value="Etc/GMT+10">(GMT-10:00) Hawaii</option>
<option value="Pacific/Marquesas">(GMT-09:30) Marquesas Islands</option>
<option value="Pacific/Gambier">(GMT-09:00) Gambier Islands</option>
<option value="America/Anchorage">(GMT-09:00) Alaska</option>
<option value="America/Ensenada">(GMT-08:00) Tijuana, Baja California</option>
<option value="Etc/GMT+8">(GMT-08:00) Pitcairn Islands</option>
<option value="America/Los_Angeles">(GMT-08:00) Pacific Time (US &#038; Canada)</option>
<option value="America/Denver">(GMT-07:00) Mountain Time (US &#038; Canada)</option>
<option value="America/Chihuahua">(GMT-07:00) Chihuahua, La Paz, Mazatlan</option>
<option value="America/Dawson_Creek">(GMT-07:00) Arizona</option>
<option value="America/Belize">(GMT-06:00) Saskatchewan, Central America</option>
<option value="America/Cancun">(GMT-06:00) Guadalajara, Mexico City, Monterrey</option>
<option value="Chile/EasterIsland">(GMT-06:00) Easter Island</option>
<option value="America/Chicago">(GMT-06:00) Central Time (US &#038; Canada)</option>
<option value="America/New_York">(GMT-05:00) Eastern Time (US &#038; Canada)</option>
<option value="America/Havana">(GMT-05:00) Cuba</option>
<option value="America/Bogota">(GMT-05:00) Bogota, Lima, Quito, Rio Branco</option>
<option value="America/Caracas">(GMT-04:30) Caracas</option>
<option value="America/Santiago">(GMT-04:00) Santiago</option>
<option value="America/La_Paz">(GMT-04:00) La Paz</option>
<option value="Atlantic/Stanley">(GMT-04:00) Faukland Islands</option>
<option value="America/Campo_Grande">(GMT-04:00) Brazil</option>
<option value="America/Goose_Bay">(GMT-04:00) Atlantic Time (Goose Bay)</option>
<option value="America/Glace_Bay">(GMT-04:00) Atlantic Time (Canada)</option>
<option value="America/St_Johns">(GMT-03:30) Newfoundland</option>
<option value="America/Araguaina">(GMT-03:00) UTC-3</option>
<option value="America/Montevideo">(GMT-03:00) Montevideo</option>
<option value="America/Miquelon">(GMT-03:00) Miquelon, St. Pierre</option>
<option value="America/Godthab">(GMT-03:00) Greenland</option>
<option value="America/Argentina/Buenos_Aires">(GMT-03:00) Buenos Aires</option>
<option value="America/Sao_Paulo">(GMT-03:00) Brasilia</option>
<option value="America/Noronha">(GMT-02:00) Mid-Atlantic</option>
<option value="Atlantic/Cape_Verde">(GMT-01:00) Cape Verde Is.</option>
<option value="Atlantic/Azores">(GMT-01:00) Azores</option>
<option value="Europe/Belfast">(GMT) Greenwich Mean Time : Belfast</option>
<option value="Europe/Dublin">(GMT) Greenwich Mean Time : Dublin</option>
<option value="Europe/Lisbon">(GMT) Greenwich Mean Time : Lisbon</option>
<option value="Europe/London">(GMT) Greenwich Mean Time : London</option>
<option value="Africa/Abidjan">(GMT) Monrovia, Reykjavik</option>
<option value="Europe/Amsterdam">(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna</option>
<option value="Europe/Belgrade">(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague</option>
<option value="Europe/Brussels">(GMT+01:00) Brussels, Copenhagen, Madrid, Paris</option>
<option value="Africa/Algiers">(GMT+01:00) West Central Africa</option>
<option value="Africa/Windhoek">(GMT+01:00) Windhoek</option>
<option value="Asia/Beirut">(GMT+02:00) Beirut</option>
<option value="Africa/Cairo">(GMT+02:00) Cairo</option>
<option value="Asia/Gaza">(GMT+02:00) Gaza</option>
<option value="Africa/Blantyre">(GMT+02:00) Harare, Pretoria</option>
<option value="Asia/Jerusalem">(GMT+02:00) Jerusalem</option>
<option value="Europe/Minsk">(GMT+02:00) Minsk</option>
<option value="Asia/Damascus">(GMT+02:00) Syria</option>
<option value="Europe/Moscow">(GMT+03:00) Moscow, St. Petersburg, Volgograd</option>
<option value="Africa/Addis_Ababa">(GMT+03:00) Nairobi</option>
<option value="Asia/Tehran">(GMT+03:30) Tehran</option>
<option value="Asia/Dubai">(GMT+04:00) Abu Dhabi, Muscat</option>
<option value="Asia/Yerevan">(GMT+04:00) Yerevan</option>
<option value="Asia/Kabul">(GMT+04:30) Kabul</option>
<option value="Asia/Yekaterinburg">(GMT+05:00) Ekaterinburg</option>
<option value="Asia/Tashkent">(GMT+05:00) Tashkent</option>
<option value="Asia/Kolkata">(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi</option>
<option value="Asia/Katmandu">(GMT+05:45) Kathmandu</option>
<option value="Asia/Dhaka">(GMT+06:00) Astana, Dhaka</option>
<option value="Asia/Novosibirsk">(GMT+06:00) Novosibirsk</option>
<option value="Asia/Rangoon">(GMT+06:30) Yangon (Rangoon)</option>
<option value="Asia/Bangkok">(GMT+07:00) Bangkok, Hanoi, Jakarta</option>
<option value="Asia/Krasnoyarsk">(GMT+07:00) Krasnoyarsk</option>
<option value="Asia/Hong_Kong">(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi</option>
<option value="Asia/Irkutsk">(GMT+08:00) Irkutsk, Ulaan Bataar</option>
<option value="Australia/Perth">(GMT+08:00) Perth</option>
<option value="Australia/Eucla">(GMT+08:45) Eucla</option>
<option value="Asia/Tokyo">(GMT+09:00) Osaka, Sapporo, Tokyo</option>
<option value="Asia/Seoul">(GMT+09:00) Seoul</option>
<option value="Asia/Yakutsk">(GMT+09:00) Yakutsk</option>
<option value="Australia/Adelaide">(GMT+09:30) Adelaide</option>
<option value="Australia/Darwin">(GMT+09:30) Darwin</option>
<option value="Australia/Brisbane">(GMT+10:00) Brisbane</option>
<option value="Australia/Hobart">(GMT+10:00) Hobart</option>
<option value="Asia/Vladivostok">(GMT+10:00) Vladivostok</option>
<option value="Australia/Lord_Howe">(GMT+10:30) Lord Howe Island</option>
<option value="Etc/GMT-11">(GMT+11:00) Solomon Is., New Caledonia</option>
<option value="Asia/Magadan">(GMT+11:00) Magadan</option>
<option value="Pacific/Norfolk">(GMT+11:30) Norfolk Island</option>
<option value="Asia/Anadyr">(GMT+12:00) Anadyr, Kamchatka</option>
<option value="Pacific/Auckland">(GMT+12:00) Auckland, Wellington</option>
<option value="Etc/GMT-12">(GMT+12:00) Fiji, Kamchatka, Marshall Is.</option>
<option value="Pacific/Chatham">(GMT+12:45) Chatham Islands</option>
<option value="Pacific/Tongatapu">(GMT+13:00) Nuku'alofa</option>
<option value="Pacific/Kiritimati">(GMT+14:00) Kiritimati</option>
</pre>
<p>If anybody can offer any improvements to this or a different suggestion altogether, that would be great.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aviblock.com/blog/2009/03/12/presenting-a-list-of-timezones-to-the-user/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
	</channel>
</rss>

