Title: Documentation of time.time() differs from source documentation
Type: Stage:
Components: Documentation Versions: Python 2.5
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: cgrohmann, georg.brandl, loewis
Priority: normal Keywords:

Created on 2008-06-24 05:53 by cgrohmann, last changed 2008-06-24 07:09 by loewis. This issue is now closed.

Messages (4)
msg68666 - (view) Author: Carsten Grohmann (cgrohmann) Date: 2008-06-24 05:53
The current python documentation of the time module
( means that time.time()
returns the "seconds since the epoch, in UTC".

But in the current source documentation of the time module
is written that "time() -- return current time in seconds since the Epoch". 

time.time() returns the current local unix seconds during tests on a
system using Python 2.5.

Please adapt the documentation.

msg68667 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-06-24 06:14
I cannot see the difference. The docstring doesn't say "current local
time", it says "current time". What do you mean by "current local unix
seconds" - that phrase makes no sense.

time.time() returns the seoncds since the Epoch, and they must be
interpreted in UTC, always. So both documentation texts are correct, and
they say the same thing.
msg68668 - (view) Author: Carsten Grohmann (cgrohmann) Date: 2008-06-24 06:51
"current local unix seconds" means seconds since the Epoch in local

I've attached a small example to show that is no difference between the
time returned by time.localtime() and time.time(). So I assume that
time.time() also returns local time and not UTC.

>>> time.mktime(time.localtime())
>>> time.time()
msg68671 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-06-24 07:09
I think you are misinterpreting what you are seeing. time.mktime returns
seconds since the Epoch, in UTC, when passed broken-down local time. So
that the result is the same as time.time() doesn't mean that time.time()
returns "local unix seconds" (there is no such thing), but it means that
both time.time() and time.mktime() return seconds since the Epoch, in UTC.

Closing as invalid.
Date User Action Args
2008-06-24 07:09:39loewissetstatus: open -> closed
resolution: not a bug
messages: + msg68671
2008-06-24 06:51:50cgrohmannsetmessages: + msg68668
2008-06-24 06:14:54loewissetnosy: + loewis
messages: + msg68667
2008-06-24 05:53:03cgrohmanncreate