Custom date string to Python date object
<p>I am using Scrapy to parse data and getting date in <code>Jun 14, 2016
</code> format, I have tried to parse it with <code>datetime.strftime</code> but </p>

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

<p><strong>UPDATE</strong></p>

<p>I want to parse UNIX timestamp to save in database.</p>

<p>Something like this should work:</p>

<pre><code>import time
import datetime
datestring = "September 2, 2016"

unixdatetime = int(time.mktime(datetime.datetime.strptime(datestring, "%B %d, %Y").timetuple()))
print(unixdatetime)
</code></pre>

<p>Returns: <code>1472792400</code></p>

python date converter python-3.5