C.K.s time zone picker project source code
I was doing some time related recently stuff, and I started to mess around with different time zones. Built a little time zone picker control, and implemented the time using the zone. Was a little more complex that I had at first expected.
Since I went through the pain of doing it, I figured I might save you some time and share my Time Zone Picker. This simple sample lets you pick a time zone, and then displays the time & time zone name based on what you've picked.
Time Zones themselves are pretty straightforward, but arranging them so they can be used in the UIPickerControl is a bit more fiddly. To do this I made some classes to handle all the fiddly time zone stuff and manage it for the standard UIPicker control.
ckTimeZoneElement and ckTimeZoneListBundle deconstruct and organize system time zones into a data structure that’s easy to use in the Picker, and easy to hand off to your time drawing routine later. You might find it very handy
The ckTZDrawView draws the current time for that time zone, and the current time zone name. Again, you might think this is straightforward, but it’s a bit complicated, so here’s the code for you to have fun with.
This is released under the Fredware license.