Change Date Formate

44 views
Skip to first unread message

kkwaq...@gmail.com

unread,
Sep 15, 2020, 6:21:42 AM9/15/20
to Django users
How to change date format in django (yyyymmdd to ddmmyyyy)  

p.jpg
p1.jpg
how to change like this dd/mm/yyyy

Mohammad Ahshan Danish

unread,
Sep 15, 2020, 6:59:41 AM9/15/20
to django...@googlegroups.com
{{you_date_field|date:'Y-m-d'}}

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/fd9f1b17-cc30-43f9-9855-c7c5f68e7800n%40googlegroups.com.


--
Thanks & Regards 
  
Regards, 
Danish

Niraj Panchasara

unread,
Sep 15, 2020, 9:22:03 AM9/15/20
to Django users
Hi
in your html file try to set like below
{your_date_reference | date: "Y-m-d" }

Thanks

Niraj Panchasara

unread,
Sep 15, 2020, 9:22:16 AM9/15/20
to Django users
Y for yyyy
m for mm
d for dd

as per you needed, try this out in html with django template code

{{you_date_field|date:'d/m/Y'}}

waqar khan

unread,
Sep 15, 2020, 11:00:13 AM9/15/20
to django...@googlegroups.com
Thanks guys you code 100% work

Reply all
Reply to author
Forward
0 new messages