Using pytz, I am able to get a list of timezones like so:
>>> from pytz import country_timezones
>>> print(\' \'.join(country_
I think you're going to need to manually search the timezone database for the city you're looking for:
from pytz import country_timezones, timezone
def find_city(query):
for country, cities in country_timezones.items():
for city in cities:
if query in city:
yield timezone(city)
for tz in find_city('Zurich'):
print(tz)
(that's just a quick-and-dirty solution, it for instance doesn't try to match only the city-part of a timezone – try searching for Europe, it does substring matches, doesn't search case-insensitive, etc.)