from datetime import datetime date_object = datetime.strptime(‘Jun 1 2012 1:33PM’, ‘%b %d %Y %I:%M%p’) notes, the ‘format’ of the datetime string must match the string need to converted to datetime.
↧