Reputation: 49
I have a list of dates in datetime format and i d'like formate this.
form example:
{% for date in dates %}
{{date}}
{% endfor %}
Upvotes: 4
Views: 9801
Reputation: 33309
You can use the python strftime function. It works in Jinja2.
{% for date in dates %}
{{ date.strftime('%Y-%m-%d') }}
{% endfor %}
Upvotes: 12