Antoine Pitrou added the comment: > It makes a difference. It seems with the current behaviour, the > "epoch" is _in the local timezone_.
No it isn't. Two different machines: $ LANG=C date Wed Jan 16 21:47:03 UTC 2013 $ python -c "import time; print(time.time())" 1358372827.5 $ LANG=C date Wed Jan 16 22:47:21 CET 2013 $ python -c "import time; print(time.time())" 1358372848.2 time.time() *is* timezone-independent. Now to your question: > However, what I'd really prefer is a new function that returns the > seconds since the epoch in UTC. >>> epoch = datetime(1970, 1, 1) >>> (datetime.utcnow() - epoch).total_seconds() 1358372978.448235 >>> time.time() 1358372980.176238 ---------- nosy: +pitrou _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue12758> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com