Update: I lean towards extracting data from Wikipedia and creating the picker myself: List of time zones by country and daylight saving time by country. It still has some issues: I don't get all official names of the time zones and I have to provide for daylight saving times myself. Also providing different languages might be a problem.
I want the users of my web site to be able to pick their time zone (or in fact also use the site with time zones other than their own). My current idea to make it feasible is to make the user select their country first, then offer a list of time zones from that country to select. (Selecting the country would be optional, without the country there would be a list of all available time zones to choose from).
Everything on the web points to the Olson database, but I have issues with it. I would prefer to display the official time zones for a country, not the weird Olson names. For example according to Wikipedia on US time zones the USA officially has 9 timezones , but the Olson database seems to provide at least 31 time zones for the US. Overall I think the Olson database has way too many entries, and it is not clear to me how to boil them down to the official time zones.
I don't like the solution of a map based picker very much, either, because not everybody might be aware of their current location on the map.
Of course I will offer automatic location, but that is only a nice to have add on. Also it wouldn't help for users who want to get data for a different time zone than their own.
Many thanks in advance for any ideas!
Edit: I accept that I may have to go via geography. But then how could I get an official time zone name from the Olson name? I suppose I could find the Olson time zone via geography, but I don't want to display something like "timezone: America/Indiana/Vincennes" in my app).
(Incidentally my current app is written in Java, but I would also like to hear about general solutions or available databases).
There's a program called tzselect, which I believe is standard across many different Linux distributions, that lets you select a timezone interactively.
It first asks you the continent/ocean, then the country, and then any division within the country if any. Alternatively, you can enter a geographic coordinate and choose a timezone from the list of close ones.
It's written in shell script, and you may want to take a look at the source and see how it works.