How to parse multiple dates from a block of text in Python (or another language)

前端 未结 4 1548
一向
一向 2021-01-01 17:43

I have a string that has several date values in it, and I want to parse them all out. The string is natural language, so the best thing I\'ve found so far is dateutil.

4条回答
  •  抹茶落季
    2021-01-01 18:35

    I think if you put the "words" in an array, it should do the trick. With that you can verify if it is a date or no, and put in a variable.

    Once you have the date you should use datetime library library.

提交回复
热议问题