Answer the question
In order to leave comments, you need to log in
Django doesn't show date using |date conversion, where to look for error?
There is a model in models.py
class PublicField(models.Model):
pub_date = models.DateTimeField(auto_now_add=True)
def public_field(request, publicfield_id):
publicfield = PublicField.objects.get(id=publicfield_id)
return render_to_response('my_template.html', {'publicfield': publicfield})
{{ publicfield.pub_date|date }}
2014-08-13 20:28:26.896337
Answer the question
In order to leave comments, you need to log in
Apparently, you either have a string and not a datetime object fed to the |date filter, or this is a bug regarding the date filter and dates with timezones
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question