time.mktime behaves differently on windows and linux. For a datetime value '0001-01-01 00:00:00' , on windows it throws exception "OverflowError: mktime argument out of range" while on Linux it does not throw any exception and returns an incorrect (-ve) value.
on windows -
>>> from dateutil.parser import parse
>>> dt = parse('0001-01-01 00:00:00')
>>> dt
datetime.datetime(1, 1, 1, 0, 0)
>>> time.mktime(dt.timetuple())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: mktime argument out of range
On Linux
>>> from dateutil.parser import parse
>>> dt = parse('0001-01-01 00:00:00')
>>> dt
datetime.datetime(1, 1, 1, 0, 0)
>>> time.mktime(dt.timetuple())
-62135596800.0
any pointer as to why same function is behaving differently on windows and Linux is appreciated.