Is Python's time.time() timezone specific?
很抱歉问了太基本的问题,但我看了文件后还是没能把它弄清楚。似乎我错过了或误解了一些太基本的东西。
从不同时区调用
另外,假设time.time()是从具有不同时区的地方调用的,并在其计算机上转换为utc
是的,
The
time function determines the current calendar time. The encoding of the value is
unspecified.
在几乎每一个操作系统(包括Linux,Windows,Mac OSX,和所有其他的unixes),1970年的时代是1,1,00:00 UTC和论文,在
发送的文档:
Return the time in seconds since the epoch as a floating point number.
Note that even though the time is always returned as a floating point
number, not all systems provide time with a better precision than 1
second. While this function normally returns non-decreasing values, it
can return a lower value than a previous call if the system clock has
been set back between the two calls.
维基百科说:"Unix时代"。
The Unix epoch is the time 00:00:00 UTC on 1 January 1970 (or 1970-01-01T00:00:00Z ISO 8601).
它继续
There is a problem with this definition, in that UTC did not exist in its current form until 1972; this issue is discussed below. For brevity, the remainder of this section uses ISO 8601 date format, in which the Unix epoch is 1970-01-01T00:00:00Z.
日期和时间是有趣的。
众所周知的事实:小瑞士在1894年时带什么:08(34 34分钟和8秒)。1894年6月后,这是更新到29 44。(链接)
返回值应该是相同的,因为它的偏移到UNIX的时代。
这是说,如果你把它的日期值,使用不同的timezones,想当然,DISP。
如果你在约会,那些门,每个转换UTC,安切洛蒂的话,结果是一样的。
从文档:
Most of the functions defined in this module call platform C library functions with the same name. It may sometimes be helpful to consult the platform documentation, because the semantics of these functions varies among platforms.
http://docs.python.org /图书馆/ time.html?#模块时间= time.time亮点
答案是这样的:它取决于。