Hi.
I am in Asia/Karachi timezone and am testing my application for US/Pacific timezone. Here is the scenario:
The system time that I've set is,
2016-03-24 18:02:58
and the timezone is US/Pacific
When I use the Python interpreter to print the datetime, I get
>>> print datetime.datetime.now()
2016-03-24 18:02:58.814000
>>> print datetime.datetime.utcnow()
2016-03-25 01:02:58.814000
Which is correct. But when I use my web2py application to print the same I get,
print datetime.datetime.now() # 2016-03-25 06:02:58.814000
print datetime.datetime.utcnow() # 2016-03-25 01:02:58.814000
So, the problem is that the two datetime.now() results do not match. For some reason, the application is returning a datetime which is 12 hours ahead of what it should actually return. I'm facing this issue on a Windows machine; but on Linux Mint, I'm getting correct results.
This seems like its a tricky one, who's up for a challenge? : )