datefinder icon indicating copy to clipboard operation
datefinder copied to clipboard

Incorrect Dates extracted

Open daksh-2233 opened this issue 4 years ago • 3 comments

Is there a way to specify particular date format (eg dd-mm-yyyy) The date format in the text given is dd-mm-yyyy, but dates are extracted incorrectly

Ex: datefinder.find_dates('12.02.1980 ') Expected Output: 12.02.1980

Actual output: 02.12.1980

Also, what is the purpose of base_date argument ?

daksh-2233 avatar Feb 25 '21 09:02 daksh-2233

If you know your dates are day first, pass the argument first="day" to the method.

datefinder.find_dates('12.02.1980', first='day')

https://github.com/akoumjian/datefinder/blob/master/datefinder/init.py#L305

akoumjian avatar Feb 25 '21 14:02 akoumjian

Hi @akoumjian , I tried passing the argument but it shows error :

File "date_test.py", line 2, in dates = datefinder.find_dates('12.02.2018',first="day") TypeError: find_dates() got an unexpected keyword argument 'first'

daksh-2233 avatar Feb 26 '21 05:02 daksh-2233

Hi @akoumjian , I tried passing the argument but it shows error :

File "date_test.py", line 2, in dates = datefinder.find_dates('12.02.2018',first="day") TypeError: find_dates() got an unexpected keyword argument 'first'

I also received the same error :(

amzar96 avatar Jun 14 '21 13:06 amzar96