scrapinghub / dateparser

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

PREFER_DATES_FROM future and parse("1 min") returns time 1 min ago #563

Closed raghur closed 4 years ago

raghur commented 5 years ago
In [13]: parse("1 min", settings={"PREFER_DATES_FROM" : "future"}) - datetime.now()                                                                                                          
Out[13]: datetime.timedelta(-1, 86339, 999551)

Even when 'PREFER_DATES_FROM' is set to 'future', without the 'in' keyword, the time returned in 1 min before.

Expectation is that if future dates are preferred, then 1 min should return 1 min in future.

Dimbreath commented 5 years ago

I can confirm this. Any solution so far?

Watchful1 commented 5 years ago

I submitted a pull request to fix this months ago but it was never merged: https://github.com/scrapinghub/dateparser/pull/530

noviluni commented 4 years ago

Hi @raghur @Dimbreath this is fixed in the last version 0.7.4 :tada: