parserinfo.convertyear, , parserinfo _century _year *):
from dateutil.parser import parse, parserinfo
info = parserinfo()
info._century = 1900
info._year = 1965
parse('12/31/65', parserinfo=info)
=> 1965-12-31 00:00:00
_century , , , .. 65 + 1900 = 1965.
_year + - 50. 50 _years,
:
1900 1916 1965 2015
+--- (...) ---+--- (...) ---+--- (...) ---+
^ ^ ^ ^
_century _year - 49 _year _year + 50
parsed years:
16,17,... 99,00,...15
In other words, years are 00, 01, ..., 99displayed in a time range _year - 49.. _year + 50with _year, set in the middle of this 100-year period. Using these two parameters, you can specify any cut off to you.
*) Please note that these two variables are undocumented, but are used in the default implementation for parserinfo.convertyearthe newest stable version at the time of writing, 2.5.3. IMHO the default implementation is pretty smart.
source
share