strptime format - Python : <p>I'm currently working with an API that returns date in the following format:</p>

<pre><code>d1 = '2015-06-25T18:45:24'
d2 = '2015-07-11T18:45:35'
</code></pre>

<p>So, to find the difference between two times, in days, I'm doing the following:</p>

<pre><code>import datetime
d1 = datetime.datetime.strptime(d1, "%Y-%m-%d %H:%M:%S.%f")
d2 = datetime.datetime.strptime(d2, "%Y-%m-%d %H:%M:%S.%f")
print abs((d2-d1).days)
</code></pre>

<p>However, I'm getting the following error:</p>

<pre><code>ValueError: time data '2015-06-25T18:45:24' does not match format '%Y-%m-%dT%H:%M:%S.%f'
</code></pre>

<p>I know I could just simply split the string in <code>'T'</code> and then convert, however is there an easy way to convert to such format to datetime object?</p>
