change datetime format in python
<p>I am getting this datetime in this format from my database.</p>

<pre><code>2016-09-13T08:46:59.953948+00:00
</code></pre>

<p>I want to change this date into format like </p>

<pre><code>13 sep 2016 08:46:59
</code></pre>

<p>I have used datetime module like</p>

<pre><code>import datetime
datetime.datetime.strptime(2016-09-13T08:46:59.953948+00:00, 'changing format')
</code></pre>

<p>But it is giving error </p>

<pre><code>TypeError at /admin/help
must be string, not datetime.datetime
</code></pre>

<p>You can use</p>

<pre><code>import datetime
# n is your time as shown in example
your_time = n.strftime("%d/%m/%y %H:%M:%S") 
</code></pre>

<p>When trying to make human readable format I recommend <a href="https://docs.djangoproject.com/en/1.10/ref/contrib/humanize/" rel="nofollow">django humanize</a></p>

python django