S
S
s_katala2018-05-23 15:46:26
Django
s_katala, 2018-05-23 15:46:26

Django date localization?

Tell me how to display the date so that the format is in English, I output it like
this

<time class="timeago" datetime="{{user.date_joined|date:'r'}}"></time>

now
<time class="timeago" datetime="Вт, 22 Май 2018 21:36:33 +0300"></time>

need
<time class="timeago" datetime="Sat, 22 May 2018 21:36:33 +0300"></time>

If I switch USE_I18N = True to False in settings.py, everything works as it should! But then the admin panel in English
is necessary so that only the date is in the required format

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2018-05-23
@s_katala

{% load i18n %}

{% language 'en' %}
  {{user.date_joined|date:'r'}}
{% endlanguage %}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question