When I try to use time.localtime() in Python, I get a different time than the one returned by the "date" command in the shell. I am running this on a Windows box in Cygwin (using MinTTY)
$ which date
/usr/bin/date
$ date --version
date (GNU coreutils) 8.24
Packaged by Cygwin (8.24-3)
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by David MacKenzie.
$ which python
/cygdrive/c/Python27/python
$ python --version
Python 2.7.12
$ date +"%Y-%m-%d %H:%M:%S"
2016-11-19 23:06:42
$ python -i
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:24:40) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> print (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
2016-11-20 07:06:46
Anybody know how to fix this discrepancy?