Issue
I have dates in ISO 8601 format in the database, %Y-%m-%d
. However, when the date is passed on to the template, it comes out as something like Oct. 16, 2011
.
Is there a way that I can manipulate the format to whatever I want?
Solution
Within your template, you can use Django's date
filter. E.g.:
<p>Birthday: {{ birthday|date:"M d, Y" }}</p>
Gives:
Birthday: Jan 29, 1983
More formatting examples in the date filter docs.
Answered By - medmunds
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.