Python - Datetime.now() Returns Incorrect Time
I want to store in my data base the time stamp of an operation. The problem is that the time that I get from datetime.datetime.now()is incorrect (I guess it's due to time zone). I
Solution 1:
Try this adjusting the number of hours depending on the timezone you are:
import datetime
datetime.datetime.utcnow()+datetime.timedelta(hours=3)
Post a Comment for "Python - Datetime.now() Returns Incorrect Time"