Date format for django's SelectDateWidget

泄露秘密 提交于 2019-12-04 13:09:57

DATE_FORMAT works with SelectDateWidget but you have to use format strings without percents (as used in: now template tag) like this:

DATE_FORMAT = 'j N Y'

Have you tried this setting yet ? According to the docs, it seems DATE_FORMAT= has been a valid setting since version 1.0. Are you using a pre-1.0 version of django?

http://docs.djangoproject.com/en/1.0/ref/settings/#date-format

The correct way to do this is with spaces rather than forward slashes i.e.

DATE_FORMAT = "%d %m %Y"
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!