python – Is there a list of Pytz Timezones?

python – Is there a list of Pytz Timezones?

You can list all the available timezones with pytz.all_timezones:

In [40]: import pytz
In [41]: pytz.all_timezones

There is also pytz.common_timezones:

In [45]: len(pytz.common_timezones)
Out[45]: 403

In [46]: len(pytz.all_timezones)
Out[46]: 563

Dont create your own listpytz has a built-in set:

import pytz
>>> {Europe/Vienna, America/New_York, America/Argentina/Salta,..}

You can then apply a timezone:

import datetime
tz = pytz.timezone(Pacific/Johnston)
ct =
>>> ct.isoformat()

Or if you already have a datetime object that is TZ aware (not naive):

# This timestamp is in UTC
my_ct =

# Now convert it to another timezone
new_ct = my_ct.astimezone(tz)
>>> new_ct.isoformat()

python – Is there a list of Pytz Timezones?

The timezone name is the only reliable way to specify the timezone.

You can find a list of timezone names here:
Note that this list contains a lot of alias names, such as US/Eastern for the timezone that is properly called America/New_York.

If you programatically want to create this list from the zoneinfo database you can compile it from the file in the zoneinfo database. I dont think pytz has an API to get them, and I also dont think it would be very useful.

Leave a Reply

Your email address will not be published. Required fields are marked *