-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
def nowUnix returns the wrong time #188
Comments
Sounds very much as a timezone gone wrong. My guess is that the python code returns the timestamp in GMT and your system is set to GMT+1 or GMT-1. Could this be the case? On June 5, 2015 8:22:55 AM GMT+02:00, nojeffrey notifications@github.com wrote:
|
I'm in +10 timezone here which is 36000 seconds off UTC time. if I run: >>> time.time(), in python it returns the right epoch time(UTC): 1433489239 If i do a failed SSH login, and check the DB, I see this line: This timestamp is 1 hour off of UTC time, and 11 hours off my +10 timezone. |
In core/dblog.py, line 61:
def nowUnix(self):
"""return the current UTC time as an UNIX timestamp"""
return int(time.mktime(time.gmtime()[:-1] + (-1,)))
If I just run this inside python:
If i just run this from command line:
$ date +"%s"
$ 1433483440
It's 36000 seconds off, is this normal?
The text was updated successfully, but these errors were encountered: