Does Python's time.time() return a timestamp in UTC? [duplicate]
问题 This question already has answers here : Does Python's time.time() return the local or UTC timestamp? (7 answers) Closed 3 years ago . I need to generate a UNIX timestamp in UTC time so I'm using time.time() to produce it. Do I need to do anything else or is the timestamp automatically in UTC? 回答1: Technically, time.time() doesn't specify, and practically, at least in CPython, it returns a timestamp in whatever format is used by the underlying standard C library's time function. The C