Fix Python – How to make a timezone aware datetime object
What I need to do
I have a timezone-unaware datetime object, to which I need to add a time zone in order to be able to compare it with other timezone-aware datetime objects. I do not want to convert my entire application to timezone unaware for this one legacy case.
What I’ve Tried
First, to demonstrate the problem:
Python 2.6.1 (r261:67515, Jun 2….