scrapinghub / dateparser

python parser for human readable dates
BSD 3-Clause "New" or "Revised" License
2.55k stars 465 forks source link

Unexpected result - dateparser is not working for some dateformat #463

Closed anoopparampil closed 4 years ago

anoopparampil commented 5 years ago

dateparser.parse('05-11-18', settings={'PREFER_DATES_FROM': 'future'})

is giving the below output

datetime.datetime(2118, 5, 11, 0, 0)

trideeprath commented 5 years ago

The problem is here: https://github.com/scrapinghub/dateparser/blob/master/dateparser/parser.py#L402

Adds/subtracts 100 instead of 1

Not sure why ?

Gallaecio commented 4 years ago

@anoopparampil What output are you expecting? You are asking to interpret '05-11-18' as a date after 2018-11-06 (when you opened this ticket).