The function to get a datetime from a string, datetime.strptime(date_string, format) requires a string format as the second argument. Is there a way to build a
You can use datefinder ,It will detect all types of natural style of dates.
import datefinder # Module used to find different style of date with time
string_value = " created 01/15/2005 by ACME inc.and associates.January 4th,2017 at 8pm"
matches = datefinder.find_dates(string_value)
for match in matches:
print("match found ",match)
Output
match found 2005-01-15 00:00:00
match found 2017-01-04 20:00:00