I have the following string which I am trying to convert to a datetime in python

From django template I am getting the following date format:

July 1, 2013, midnight

I am trying to convert the string above into a date time format

```
date_object = datetime.strptime(x, '%B %d, %Y, %I:%M %p')

```

It throws a format error

time data 'July 1, 2013, midnight' does not match format '%B %d, %Y, %I:%M %p'