If you use the datetime property, the returned object is an instance of datetime, not a string.
On console
>>> from datetime import datetime >>> x = datetime.now() >>> print x 2012-06-25 12:03:15.835467 >>> x.date() datetime.date(2012, 6, 25) >>> >>> print x.date() 2012-06-25 >>>
See print instructions. It does an implicit conversion to string. If you specify the value of the datetime property in the template, this is likely to happen.
Thus, in your code, you should simply use the .date () method for the datetime object.
source share