﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
1443	No support for dates before 1900	Antti Kaihola	Adrian Holovaty	"See logviewer for a [http://simon.bofh.ms/logger/django/2006/03/01/23/20/ short discussion].

#1070 changed date validation so dates before 1900 raise an error. But that's only to avoid problems further down the road.

{{{
>>> datetime(1805,12,24).strftime('%Y-%m-%d')
ValueError: year=1805 is before 1900; the datetime strftime() methods require year >= 1900
}}}

Using PHP-style date formatting is broken too:
{{{
>>> dateformat.format(datetime(1899,4,12), 'Y-m-d')
/usr/local/lib/djangomr2458/django/utils/tzinfo.py in _isdst(self, dt)
---> 50         stamp = time.mktime(tt)
ValueError: year out of range
}}}

The problem is deeper in Python (or C, or the OS, or whatever):
{{{
>>> time.mktime((1901,12,14,0,0,0,0,0,0))
-2147477992.0
>>> time.mktime((1901,12,13,0,0,0,0,0,0))
OverflowError: mktime argument out of range
>>> time.mktime((1899,12,31,0,0,0,0,0,0))
ValueError: year out of range
}}}

Would mx.!DateTime be a solution?
{{{
>>> mx.DateTime.Date(1543,12,24).strftime('%Y-%m-%d')
'1543-12-24'
}}}
I realize that adding another external module dependency is not a Good Thing. Maybe it's worth checking if mx.DateTime is similar enough to be used as a drop-in replacement for datetime in case it's installed on the system? This way those who need to go back to 19th century or before could just install mx.!DateTime and enjoy.
"	defect	closed	Core (Other)	dev	normal	fixed	date 1900 datetime	rafaelbm_sbo@… gary.wilson@… brian.mabry.edwards@… greenwaldjared@… simon@…	Accepted	1	0	0	0	0	0
