Python TimeZone: A Guide To Work With Different Timezones ...
pynative.com › python-timezoneDec 05, 2021 · Extract the timezone name from UTC DateTime using the DateTime formatting in Python. Use the %Z directive to get the timezone name. from datetime import datetime import pytz datetime_india = datetime.now(pytz.timezone('Asia/Kolkata')) print("Formatted DateTime in IST : ", datetime_india.strftime('%Y:%m:%d %H:%M:%S %Z %z')) # Output 2021:07:08 17:53:23 IST +0530. Note: IST is the timezone name
List All TimeZones in Python – PYnative
pynative.com › list-all-timezones-in-pythonDec 05, 2021 · Below are the methods and attributes to get all timezone names: – all_timezones: Returns the list of all the timezones supported by the timezone module; all_timezones_set: Returns a set with all the timezones supported by the timezone module; common_timezones and common_timezones_set: Provides a list and set of the commonly used timezones.