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
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.