I am implementing a function with a scheduled publication of an object. The user chooses the time to publish, and I created a cron task to run every minute and check if there is a publication time.
Users from different time zones.
So, I need to compare two datetime times:
>>user_chosen_time datetime.datetime(2012, 12, 4, 14, 0, tzinfo=tzinfo(120)) >>curdate=datetime.datetime.now() datetime.datetime(2012, 12, 4, 18, 4, 20, 17340) >>user_chosen_time==curdate *** TypeError: can't compare offset-naive and offset-aware datetimes
Sorry for the rather stupid question, but I need to discuss this. Thanks
Feanor
source share