customize dateutil.parser century inference logic
问题 I am working on old text files with 2-digit years where the default century logic in dateutil.parser doesn't seem to work well. For example, the attack on Pearl Harbor was not on dparser.parse("12/7/41") (which returns 2041-12-7). The buit-in century "threshold" to roll back into the 1900's seems to happen at 66: import dateutil.parser as dparser print(dparser.parse("12/31/65")) # goes forward to 2065-12-31 00:00:00 print(dparser.parse("1/1/66")) # goes back to 1966-01-01 00:00:00 For my