
On 5/24/25 5:04 AM, Stephen J. Turnbull wrote:
Christian Schneider writes:
In settings.py I set DATETIME_FORMAT to 'd-m-Y H:i:s' but the format did not change.
I'm not sure what DATETIME_FORMAT is used for in Django 3.x.
I doubt the OP is using Django 3.2. I suspect the URL <https://docs.djangoproject.com/en/3.1/ref/settings/#std:setting-DATETIME_FOR...> came from a search result and the OP actually has Django 4.2 or 5.0 (django_mailman3 >= 1.3.12 requires django>=4.2,<5.1).
Note that the doc for DATETIME_FORMAT for Django >=5.0 removes the note about USE_L10N = True and says "Note that the locale-dictated format has higher precedence and will be applied instead."
Thus, with Django >= 5.0 I think the setting for DATETIME_FORMAT is ignored for output and the locale's format is used in all cases.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan