Custom date string to Python date object
Question: I am using Scrapy to parse data and getting date in `Jun 14, 2016 ` format, I
have tried to parse it with `datetime.strftime` but

what approach should I use to convert custom date strings and what to do in my
case.

**UPDATE**

I want to parse UNIX timestamp to save in database.


Answer: Something like this should work:

    
    
    import time
    import datetime
    datestring = "September 2, 2016"
    
    unixdatetime = int(time.mktime(datetime.datetime.strptime(datestring, "%B %d, %Y").timetuple()))
    print(unixdatetime)
    

Returns: `1472792400`

