Eldamir
Eldamir

Reputation: 10062

django settings.py DATETIME_FORMAT: %M does not correspond to Minutes

according to https://docs.djangoproject.com/en/1.5/ref/settings/#datetime-input-formats the following pattern should work if I put it into settings.py and deactivate USE_L1ON

'%Y-%m-%d %H:%M:%S',     # '2006-10-25 14:30:59'

When i use it, the '%' symbols are printed too, so i cahnged it to

DATETIME_FORMAT = 'Y-m-d H:M'

This, however, yields: 2013-04-10 09:Apr

So 'M' is translated to 'abbreviated month' instead of minutes. How can I fix this? The Django doc wasn't helpful

Upvotes: 1

Views: 1614

Answers (1)

Martijn Pieters
Martijn Pieters

Reputation: 1124110

You were looking for date output formatting and i:

DATETIME_FORMAT = 'Y-m-d H:i'

From the linked documentation:

i - Minutes. - '00' to '59'

Upvotes: 3

Related Questions