In Jinja2, how would you specify a default rendering method for a certain type?
In particular, datetime
?
I found it quite annoying when rendering datetime values from Django. They look like 2022-11-04T00:00:00.987654+00:00
. What was that T
for, and why there was a plus +
followed by 00:00
. My users who lived on small islands for their entire life wouldn't understand.
Aside from the formatting problem, Django gives UTC time objects. Always UTC, despite the TIME_ZONE
in its settings module has been specified with a different value.
I know I can use a filter thing like me.time_of_death|format_datetime
. However putting it after every single datetime field sounds insane to me, and I don't want to be woken up in the midnight because of a datetime without that filter released on the previous day.
Is it possible to make it default?