I am new to django. In my template I need the current date as date format, while the following code returns string:
<p>{% now "Y-m-d" as date %}</p>
where I want the date in format of 2018-12-17 as a date not string. Is there anyway to do that?
thnaks
You can use filters built into django
{{ value|date:"D d M Y" }}
find more here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With