Converting string into datetime
Asked 07 September, 2021
Viewed 2.6K times
  • 54
Votes

I've got a huge list of date-times like this as strings:

Jun 1 2005  1:33PM
Aug 28 1999 12:00AM

I'm going to be shoving these back into proper datetime fields in a database so I need to magic them into real datetime objects.

This is going through Django's ORM so I can't use SQL to do the conversion on insert.

24 Answer