scrapinghub / dateparser

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

Issue parsing "in 1d" #863

Closed kaylynnnn closed 1 year ago

kaylynnnn commented 3 years ago

There's an issue parsing in "in 1d" with dateparser where it returns None but in 1s, in 1m, in 1h and in 1w returns the appropriate times.

>>> dateparser.parse("in 1s"), dateparser.parse("in 1m"), dateparser.parse("in 1h"), dateparser.parse("in 1d"), dateparser.parse("in 1w")
(datetime.datetime(2020, 12, 29, 15, 43, 32, 675063), datetime.datetime(2020, 12, 29, 15, 44, 31, 681036), datetime.datetime(2020, 12, 29, 16, 43, 31, 683038), None, datetime.datetime(2021, 1, 5, 15, 43, 34, 798560))
Gallaecio commented 3 years ago

What happens if you force the language to English?

kaylynnnn commented 3 years ago

What happens if you force the language to English?

>>> import dateparser
>>> dateparser.parse("in 1d", languages=["en"])
>>>

I get the same result.

serhii73 commented 1 year ago

It was fixed in https://github.com/scrapinghub/dateparser/pull/1103