I'd like to convert this list of strings of various unknown date formats to a python datetime object. For example:
strings = ["today", "tomorrow", "next Friday", "June 4th", "04/11/2022"]
convert_to_date(strings[0])
>>> 2022-04-08
convert_to_date(strings[1])
>>> 2022-04-09
convert_to_date(strings[3])
>>> 2022-04-15
I tried several methods but found that:
dateutil.parseronly works for dates like04/11/2022time.strptimeandarrowboth require me to specify the formatregexwould be too complicated and may not work for all scenarios
Is there any library or function that would allow me to do something like this?