# Is There a List of pytz Timezones?

**URL:** https://sentry.io/answers/list-of-pytz-timezones/

---

## The Problem

Python applications often need to work with timezones for date-time conversion and timezone calculations, staying accurate to the timezone of a particular location.

But if you want to make use of a specific timezone, or access a list of popular timezones, how do you list available timezones in Python?

## The Solution

### Using `zoneinfo` (recommended, Python 3.9+)

Since Python 3.9, the [`zoneinfo`](https://docs.python.org/3/library/zoneinfo.html) module is part of the standard library, so no extra dependency is needed. Use `zoneinfo.available_timezones()` to get a set of all available IANA timezone names:

```python
from zoneinfo import available_timezones

print(sorted(available_timezones()))
```

Output (shortened):

```python
['Africa/Abidjan', 'Africa/Accra', 'Africa/Addis_Ababa', 'Africa/Algiers', ... 'US/Samoa', 'UTC', 'W-SU', 'WET', 'Zulu']
```

Because `available_timezones()` returns a set, you can filter it the same way. For example, to list European timezones:

```python
from zoneinfo import available_timezones

europe_timezones = sorted(tz for tz in available_timezones() if tz.startswith("Europe/"))
print(europe_timezones)
```

Output (shortened):

```python
['Europe/Amsterdam', 'Europe/Andorra', 'Europe/Astrakhan', 'Europe/Athens', ... 'Europe/Warsaw', 'Europe/Zagreb', 'Europe/Zaporozhye', 'Europe/Zurich']
```

### Using pytz (for projects that already use pytz)

If your project already depends on [pytz](https://pypi.org/project/pytz/), you can list timezones with the `all_timezones` attribute:

```python
import pytz

print(pytz.all_timezones)
```

This attribute returns a list of all the time zones supported by the pytz module.

Output (shortened):

```python
['Africa/Abidjan', 'Africa/Accra', 'Africa/Addis_Ababa', 'Africa/Algiers', ... 'US/Samoa', 'UTC', 'Universal', 'W-SU', 'WET', 'Zulu']
```

You can also filter for specific regions, for example European timezones:

```python
import pytz

europe_timezones = [timezone for timezone in pytz.all_timezones if "Europe" in timezone]
print(europe_timezones)
```

Output (shortened):

```python
['Europe/Amsterdam', 'Europe/Andorra', 'Europe/Astrakhan', 'Europe/Athens', ... 'Europe/Warsaw', 'Europe/Zagreb', 'Europe/Zaporozhye', 'Europe/Zurich']
```

pytz also provides the `common_timezones_set` attribute that returns commonly used timezones as a set:

```python
import pytz

common_timezones = pytz.common_timezones_set
print(common_timezones)
```

Output (shortened):

```python
LazySet({'America/Indiana/Vevay', 'US/Arizona', 'Asia/Yerevan', ... 'Asia/Chita', 'Pacific/Saipan', 'Africa/Nouakchott'})
```

---

*Source: [sentry.io/answers/list-of-pytz-timezones/](https://sentry.io/answers/list-of-pytz-timezones/)*
