#36205: Date format issue in Django 5.1.6
-------------------------------------+-------------------------------------
Reporter: liqianqian160 | Type:
| Uncategorized
Status: new | Component:
| Uncategorized
Version: 5.1 | Severity: Normal
Keywords: Date format issue | Triage Stage:
in Django 5.1.6 | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
In Django 5.1.6, when setting USE_L10N = False and DATETIME_FORMAT =
'Y-m-d H:i:s', the expectation is that DateTimeField in the Admin
interface displays as '2024-04-15 23:33:00'. However, it displays as
'April 15, 2024, 11:33 p.m.' (default en-us format). This worked correctly
in previous versions (e.g., 5.0.x or 4.x).
Steps to reproduce:
1. Configure settings.py as follows:
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'Asia/Shanghai'
USE_I18N = True
USE_TZ = True
USE_L10N = False
DATETIME_FORMAT = 'Y-m-d H:i:s'
2. Create a model with a DateTimeField.
3. View the field in the Admin interface; the format does not follow
DATETIME_FORMAT.
Expected behavior: Displays '2024-04-15 23:33:00'.
Actual behavior: Displays 'April 15, 2024, 11:33 p.m.'.
--
Ticket URL: <
https://code.djangoproject.com/ticket/36205>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.