What is the oldest time that can be represented in Python?

前端 未结 5 921
耶瑟儿~
耶瑟儿~ 2021-02-06 21:40

I have written a function comp(time1, time2) which will return True when time1 is less than time2. I have a scenario where

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-06 22:03

    If you're using standard issue unix timestamp values then the earliest representable moment of time is back in 1970:

    >>> import time
    >>> time.gmtime(0)
    (1970, 1, 1, 0, 0, 0, 3, 1, 0)
    

提交回复
热议问题