How to get django queryset results with formatted datetime field
<p>I've Django model which has foreign keys associated with other models. Each model is having same field names(attributes) created_at and updated_at</p>

<p>In every django queryset results I'll be getting datetime values.</p>

<pre><code>Model.objects.all().values('created_at')
</code></pre>

<p>But I want to format the datetime field to "DD-MM-YYYY HH:MM:SS" and trim down the milliseconds in the django query results.</p>

<p>If I use "extra" and and date_trunc_sql like the following command</p>

<pre><code>dt = connection.ops.date_trunc_sql('day','created_date')
objects.extra({'date':dt}).values('date')
</code></pre>

<p>Which works fine. But If I query like the following, its raising ambiguous statement error.</p>

<pre><code>objects.extra({'date':dt}).values('date', 'x', 'y', 'z')
</code></pre>

<p>How to overcome this problem?</p>