K
K
KirillTrueno2022-03-28 20:57:54
Django
KirillTrueno, 2022-03-28 20:57:54

How to format date in Jinja Flask templates?

I'm rewriting a project from Django to Flask, and in the Django templates the date is displayed like this:
{{ article.date|date:"j E Y" }}

How to do the same in Flask?
Is it necessary to write your own filter?
The jijna documentation doesn't say anything about date formatting.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2022-03-28
@KirillTrueno

{{ article.date.strfrime('%d %B %Y') }}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question