django template date filter format string question
I have a datetime value that is available in a django 开发者_如何转开发template.
I am trying to format the date as "d-mmm"
so for example dates are formated as:
- 5-Mar
- 10-Mar
- 4-Apr
etc.
I have tried different combinations - NOTHING works so far?. I hope I dont have to write a custom filter just to format a date ?
[Edit]
I tried the 'obvious' format string like: 'j-M', 'j-N', (even 'j-mmm' and 'd-mmm')
Have you tried {{ some_date|date:"j-M" }}
?
http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
精彩评论