Django: How to format a DateField's date representation?

后端 未结 4 1583
隐瞒了意图╮
隐瞒了意图╮ 2020-12-08 21:27

I have a form with a DateField. The existing date value is formatted to render like this:

2009-10-03

How can I format that so that it look like

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-08 21:41

    You can show date in template by means of

    {{ your_object.date_field.day }}.{{ your_object.date_field.month }}.{{ your_object.date_field.year }}
    

提交回复
热议问题