Reputation: 881
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
Upvotes: 7
Views: 16427
Reputation: 300
You can use filters built into django
{{ value|date:"D d M Y" }}
find more here
Upvotes: 15