0

I am looking for a way to format different date and time strings to a common format. For example, i get date/time data in various following formats:

  • "Mon, Aug 7th 2023"
  • "Fri, 04 Aug 2023 18:16:02 +0530"
  • "7-Aug-23"
  • "August 7, 2023"
  • "August 9, 2023 19:12 IST"
  • "2023-08-07T21:31:45.000Z"
  • "2023-08-07T20:45:09"
  • "8/5/2023 21:22"

I am looking for a way to convert these different format to common format such as DD/MM/YYYY in python.

Any help will be highly appreciated.

Mah3sh
  • 23
  • 4
  • 1
    Does this answer your question? [datetime from string in Python, best-guessing string format](https://stackoverflow.com/questions/9507648/datetime-from-string-in-python-best-guessing-string-format) – matszwecja Aug 10 '23 at 13:21
  • Thanks @matszwecja. That did help, however it didnt work for date such as "Fri, August 4, 2023, 20:54 pm". – Mah3sh Aug 11 '23 at 12:31

0 Answers0