How to change the display format of datetime fields in the Django admin interface?
I found the answer, thanks to Iain Shelvington.
In admin.py I changed the model registration from
admin.site.register(My_model)
to
@admin.register(My_model)
class My_model_Admin(admin.ModelAdmin):
list_display = ('created')
Now the datetime format is represented in the table inside the admin interface properly:
created |
---|
18.01.2022 - 16:00:56 |
It is displayed as 16:00:56 now, because I use CET in settings.py
.