Datetime value such as, day = "2017-9-2 00:00:00" ,
when used in template,
index.html
...
{{day}}
...
it is auto converted by Django to Sept. 2, 2017, midnight.
How can I disable this behavior?
I want it to display in its original format, "2017-9-2 00:00:00".
You should override
settings.DATETIME_FORMATin your settings in order to override the default format.settings.py:Now every
datetimein your project should be present in this format.EDIT: If you don't want to globally format all the dates in this format, you can specifically format this date in your template, like this: