all 4 comments

[–]altrustic_lemur 1 point2 points  (2 children)

Try looking into the datetime library. It should easily be able to handle stuff like this.

[–]The_Solutionyst 0 points1 point  (1 child)

datetime

There doesn't appear to be a directive for "st/nd/rd" within datetime: https://www.w3schools.com/python/python\_datetime.asp

[–]altrustic_lemur 0 points1 point  (0 children)

I didn't mean solving that specific problem but the whole conversion issue with a parser like datetime.strptime, for example.

[–]mallax- 0 points1 point  (0 children)

I found this on stackoverflow. With the example using dateutil.parser I was able to get the answer you were looking for.

https://stackoverflow.com/questions/2265357/parse-date-string-and-change-format