I have a datetime object that I need to convert to a given timezone and get the timezone offset at that date. Here's an example:
>>> datetime.datetime(2045,11,30, 0,0,0).strftime("%Y-%m-%dT%H:%M:%S")
'2045-11-30T00:00:00'
I would like to dynamically add in the offset for the timezone "America/Chicago", so for example, the result would look like:
'2045-11-30T00:00:00T-06:00' # fluctuates based on DST, cannot be hardcoded
How would I do this?