Answer the question
In order to leave comments, you need to log in
How to localize date in Django?
settings.py
LANGUAGE_CODE = 'ru-RU'
TIME_ZONE = 'Europe/Moscow'
USE_I18N = True
USE_L10N = True
USE_TZ = True
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j F Y, H:i'
{{article.pub_date|date:"DATETIME_FORMAT"}}
article.pub_date|date:"j F Y, H:i"
Answer the question
In order to leave comments, you need to log in
Play around with this - Built-in template tags and filters # date
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question