Is Python's time.time() timezone specific?

后端 未结 6 1343
孤街浪徒
孤街浪徒 2021-02-05 00:42

Apologies for asking too basic question but I couldn\'t get it cleared after reading docs. It just seems that I am missing or have misunderstood something too basic here.

<
6条回答
  •  难免孤独
    2021-02-05 01:13

    Per the documentation:

    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.

    Wikipedia says about "Unix epoch":

    The Unix epoch is the time 00:00:00 UTC on 1 January 1970 (or 1970-01-01T00:00:00Z ISO 8601).

    and it continues

    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.

    Time and date is fun.

    Little known fact: The time zone of Switzerland before 1894 was 34:08 (34 minutes and 8 seconds). After June 1894, it was updated to 29:44. (link)

提交回复
热议问题