skyeagle
skyeagle

Reputation: 3271

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:

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')

Upvotes: 4

Views: 15959

Answers (1)

Benjamin Wohlwend
Benjamin Wohlwend

Reputation: 31878

Have you tried {{ some_date|date:"j-M" }}?

http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date

Upvotes: 14

Related Questions