How to get the time zone from datetime with zoneinfo libraries in Python?
I have a code where I get date and time of different parts of the world with the datetime and zoneinfo libraries in Python. I am able to extract the dates and hourse separately in day, month, year, hour, minute, second and microsecond, but I don’t know hoe to extract the Time Zone part of the datetime variable I got. Part of the code is as follows:
Assigning a var to ZoneInfo(“US/Eastern”) at the start and re-using it in perpetuity without daylight saving issues?
I use the same timezone repeatedly in my python code when creating datetime objects.
So far I’ve just been creating a new ZoneInfo object each time, similar to this: