Can anyone tell me why I'm having problems with Python programs showing the incorrect time (it's giving me +5 hrs).
My computer is set correctly for EST. For example, if I went into cygdrive or cmd or powershell and then open up a python command line and do the following, I get the correct time:
>>> from datetime import datetime
>>> print(datetime.now())
2018-05-15 20:29:28.360810
However, if I try to run that same line of code within a .py file and from cygdrive, cmd, or powershell run the below code, I get the wrong date/time:
---In the 'test.py' file---
from datetime import datetime
print(datetime.now())
python test.py
2018-05-16 01:29:49.636899
Any clues what's going on?
BTW, I'm also getting an error trying to import pytz, however when I try a pip install, I get 'requirement already satisfied' with the filepath showing where it is located. Just an FYI, more than anything.
Thank you!