akoumjian / datefinder

Find dates inside text using Python and get back datetime objects
http://datefinder.readthedocs.org/en/latest/
MIT License
634 stars 166 forks source link

Searching "Date: Tue, 23 Apr 1996 13:28:27 -0400" fails to obtain date #184

Open glenstewart opened 1 year ago

glenstewart commented 1 year ago

Great tool - thanks for working on it! I ran into one condition where it seemingly should work, but doesn't:

These are simple, small HTML files... 1.htm: "text": "Date: Tue, 23 Apr 1996 13:28:27 -0400", 20.htm: "text": "Date: Thu, 28 Mar 1996 19:27:29 -0500", 7.htm: "text": "Date: Fri, 16 Aug 1996 10:33:56 PST",

datefinder returns an empty result, using the latest code obtained with pip.

glenstewart commented 1 year ago

It's the prefix "Date: " that's causing the problem. "Tue, 23 Apr 1996 13:28:27 -0400" itself works fine.

So odd.

pravsripad commented 1 year ago

I can reproduce this as well. It is the string "Date" followed by colon ":" anywhere in the string that seems to be the issue. With colon and String "Date" separately anywhere else, the results are as expected.

FANGOD commented 10 months ago

generated At Time 2023-10-23T08:20:02+00:00 on same too.