dateparser icon indicating copy to clipboard operation
dateparser copied to clipboard

`parse` parsing strings not matching `date_formats`

Open haphaeu opened this issue 2 years ago • 1 comments

Is this a bug, an undocumented feature, or maybe I didn't ready the docs thoroughly enough ?=/

In: dp.parse('Time', date_formats=['%d.%m.%Y %H:%M'])
Out: datetime.datetime(2021, 11, 19, 0, 0)

In: dp.parse('(m)', date_formats=['%d.%m.%Y %H:%M'])
Out[58]: datetime.datetime(2021, 11, 19, 0, 0)

I'd expect this to return None to be consistent when date_string doesn't match any date_formats.

In : dp.parse('something', date_formats=['%d.%m.%Y %H:%M'])
Out: None

haphaeu avatar Nov 19 '21 07:11 haphaeu

Hey @Gallaecio ! I would like to work on this one.

RyanWalker277 avatar Feb 10 '23 05:02 RyanWalker277