In Django you can define how to display your timedate variables like so:
{{ invoice.printed|date:"D jS N 'y h:i a" }}
What if I wanted to use this date format across my site but have it declared in my settings.py as:
TOOLTIPS_DATE_FORMAT = "D jS N 'y h:i a"
You can create a context processor which includes this format in all your templates:
Put this in a file such as
main/context_processors.py(or a different app if you don’t have a Django app calledmain) and then addmain.context_processors.tooltips_formattoTEMPLATE_CONTEXT_PROCESSORS(docs) in your Django settings file.You can then write in your templates: