HiveBrain v1.2.0
Get Started
← Back to all entries
patternpythondjangoCritical

Is there a list of Pytz Timezones?

Submitted by: @import:stackoverflow-api··
0
Viewed 0 times
listtheretimezonespytz

Problem

I would like to know what are all the possible values for the timezone argument in the Python library pytz. How to do it?

Solution

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

In [40]: import pytz
In [41]: pytz.all_timezones
Out[42]: 
['Africa/Abidjan',
 'Africa/Accra',
 'Africa/Addis_Ababa',
 ...]


There is also pytz.common_timezones:

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

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

Code Snippets

In [40]: import pytz
In [41]: pytz.all_timezones
Out[42]: 
['Africa/Abidjan',
 'Africa/Accra',
 'Africa/Addis_Ababa',
 ...]
In [45]: len(pytz.common_timezones)
Out[45]: 403

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

Context

Stack Overflow Q#13866926, score: 613

Revisions (0)

No revisions yet.