I am using django-model's-dateField in my django-project and wanna change my dateFields format in admin view.
Currently (default) django gives format in YYYY-MM-DD but i want to modify that and in need of DD-MM-YYYY
I've been struggled too much in this and till no solution.
Also providing my code, may help..
my settings.py have:
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
models.py:
class UserProfile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE, related_name='User_Profile')
mobile = models.BigIntegerField()
alternative_number = models.BigIntegerField()
DOB = models.DateField()
and then i register it in admin
output on admin
as you can see in my admin page there is a dateField with format 2019-11-04 but i want in form of DD-MM-YYYY as 04-11-2019.
I tried LANGUAGE_CODE = 'de-at' that would work for me but the problem is, it changes the local language also.
refering a similer post: Django - change default presentation format of model date field