Delete time from datetime format in django
So apparently the only thing i needed to do was to change "SHORT_DATETIME_FORMAT" by "SHORT_DATE_FORMAT", and that way we get rid of the time part.
Thanks guys!
I need to send an email with a date, and the date should be "mm/dd/yyyy".
From the database i get the date in this format:
2017-02-26T23:00:00Z
So I added from django.utils import formats along with all the imports and then I also added in my function final_date = formats.date_format(input_date, "SHORT_DATETIME_FORMAT")
The thing is that i get exactly what i want with the date, but also the time.
Is there any way to get rid of the time within my formatting??
I know i can use the function split(), but that seems an ugly way to achieve this.
TL;DR
What I have --> 02/20/2017 4:40 p.m.
What I want --> 02/20/2017