Python fromtimestamp OSError

前端 未结 5 1220
天命终不由人
天命终不由人 2020-12-03 16:36

For some reason when constructing datetimes using fromtimestamp, I get a \"OSError [Errno22] Invalid Argument\" when I use negative times less than -43200 (-12hrs). I am on

5条回答
  •  感动是毒
    2020-12-03 17:19

    If the timestamp is out of the range of values supported by the platform C localtime() or gmtime() functions, datetime.fromtimestamp() may raise an exception like you're seeing.

    On Windows platform, this range can sometimes be restricted to years in 1970 through 2038. I have never seen this problem on a Linux system.

提交回复
热议问题