I think I worked it out, and I was surprised that this does not exclude the same exception.
>>> datetime.datetime.fromtimestamp(0) + datetime.timedelta(seconds=2147570047) datetime.datetime(2038, 1, 20, 4, 14, 7)
EDIT: This is not an ideal solution, it seems a bit of a problem with time zones (I am currently in BST time (+1), so it may explain why it is lower by an hour)
>>> datetime.datetime.fromtimestamp(2047570047) datetime.datetime(2034, 11, 19, 17, 27, 27) >>> datetime.datetime.fromtimestamp(0) + datetime.timedelta(seconds=2047570047) datetime.datetime(2034, 11, 19, 18, 27, 27)
GP89 source share