
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. According to the docs for the 'date' and 'time' filters, they both accept a datetime object as argument, but they use DATE_FORMAT and TIME_FORMAT, respectively, to format it as a date string and a time string separately. Try
DATE_FORMAT = 'd-m-Y' TIME_FORMAT = 'H:i:s'
instead. Can't promise it will work but that's my best guess. See https://docs.djangoproject.com/en/3.1/ref/templates/builtins/#std-templatefi...
I can't figure out from the documents how you can change it when localization is enabled. I guess you have to change the localization configuration, which probably can be done from the outside the distributed source but I don't have time to search for how. So unfortunately you probably need to keep using USE_L10N = False. At least for dates that's not a big deal, only USians will be subject to confusion. Nobody else uses the insane m-d-Y convention, and in Germany even USians will probably be used to the more logical form.
Steve
-- GNU Mailman consultant (installation, migration, customization) Sirius Open Source https://www.siriusopensource.com/ Software systems consulting in Europe, North America, and Japan