Converting UTC struct_time to datetime in Python
Getting from a Python struct_time object holding time in UTC to datetime object with timezone information isn’t as trivial as it should be.
So a handy self note:
This converts struct_time object to epoch time using calendar.timegm(). timegm() function interprets passed time tuple as UTC time. Then we convert the epoch time to datetime object with added timezone information.
Hope this helps anyone else.