Timezone-aware datetime objects in Python with zoneinfo

Timezone-aware datetime objects in Python with zoneinfo

Want a Python datetime with a timezone? Use the “zoneinfo” module:

import zoneinfo
tz = zoneinfo.ZoneInfo('US/Eastern')

Then pass it to the “tzinfo” keyword arg:

dt = datetime.datetime(2026, 4, 1, 13, tzinfo=tz)