I am trying to figure out what's special about March 16th, 1984. On a virtual machine I am using (nothing special about it), Python (as well as PyPy) crashes when trying to use mktime with what seems to be a perfectly reasonable time struct.
$ pypy
Python 2.7.3 (f66246c46ca30b26a5c73e4cc95dd6235c966b8f, Jul 30 2013, 09:27:06)
[PyPy 2.0.2 with GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>> import time
>>>> time.mktime((1984,3,16,0,0,0,0,0,0))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: mktime argument out of range
>>>> time.mktime((1984,3,15,0,0,0,0,0,0))
448156800.0
>>>> time.mktime((1984,3,17,0,0,0,0,0,0))
448326000.0
>>>> time.mktime((1984,3,16,0,0,0,0,0,0))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: mktime argument out of range
>>>>
Why and what can be done to avoid this issue?
Although the problem does happen every time on this VM, I could not make it occur on any other.