time.time()
returns the value what the underlying library returns. Python uses time(..)
or gettimeofday(.., nullptr)
(depending whats available on the system).
https://github.com/python-git/python/blob/master/Modules/timemodule.c#L874
In both cases UTC is returned. E.g:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/time.html
The time() function shall return the value of time in seconds since the Epoch
After a valid comment of Matt I have to add the definition of epoch which clearly states that time
returns the UTC time.
Epoch:
Historically, the origin of UNIX system time was referred to as
"00:00:00 GMT, January 1, 1970". Greenwich Mean Time is actually not a
term acknowledged by the international standards community; therefore,
this term, "Epoch", is used to abbreviate the reference to the actual
standard, Coordinated Universal Time.
To proove the epoch is the same check this:
import time
a = time.gmtime(secs=0)
# time.struct_time(tm_year=2015, tm_mon=9, tm_mday=9, tm_hour=1, tm_min=3, tm_sec=28, tm_wday=2, tm_yday=252, tm_isdst=0)
b = time.localtime(secs=0)
# time.struct_time(tm_year=2015, tm_mon=9, tm_mday=9, tm_hour=3, tm_min=1, tm_sec=28, tm_wday=2, tm_yday=252, tm_isdst=1)
Both functions use the value returned from time.time()
if the parameter secs
is 0. In my case tm_isdst
was set to true for the localtime, and false for the gmtime (which represents the time since the epoch).
Edit: Where have you read that the value will be smaller?