Maximum value of timestamp

前端 未结 3 1058
-上瘾入骨i
-上瘾入骨i 2021-01-12 06:38

I am using Python 3.6.0 on Windows 10 x64.

I just found that in time.ctime(seconds), seconds parameter has an implicit maximum value, which

3条回答
  •  -上瘾入骨i
    2021-01-12 07:04

    This must be to do with your installation of Python, in version 3.5, I never experience such an error:

    >>> time.ctime(32536799999)
    'Mon Jan 19 07:59:59 3001'
    >>> time.ctime(32536799999+1)
    'Mon Jan 19 08:00:00 3001'
    >>> time.ctime(32536799999+9999999999999999)
    'Thu Feb 13 01:46:38 316890386'
    >>> time.ctime(32536799999+99999999999999999)
    Traceback (most recent call last):
      File "", line 1, in 
    OSError: [Errno 75] Value too large for defined data type
    

    and even when I do with a gigantic number, it throws a different error.

提交回复
热议问题