[Fixed]-How to change django datetime format output?

36👍

Per Django docs, you can use a date filter to format date:

{{ sale.validity|date:"d-m-Y"}} 

Additionally, you can also set DATE_FORMAT (or DATETIME_FORMAT) setting to set a project-wide default for displaying such values if USE_L10N is False. If it’s true, you’ll want to have a look at this documentation on format localization.

Leave a comment