django :: date filter cheat sheet

Oscar Brito

Django date filter tag 

{{ datetime|date:"Y/m/d H:i"}}

django :: date filter cheat sheet | TKBE

TimesecondssSeconds, 2 digits (with leading zeros).
minutesiMinutes (with leading zeros).
(24 hr clock)
GHour, 24-hour format without leading zeros.
HHour, 24-hour format with leading zeros.
(12 hr clock)
gHour, 12-hour format without leading zeros.
hHour, 12-hour format with leading zeros.
aa.m. or p.m.
AA.M. or P.M.
DateyearyYear, 2 digits.
YYear, 4 digits.
zDay of the year (0 – 365).
weekWISO-8601 week number.
wDay number of the week (0=Sunday, 6=Saturday).
monthnMonth number
mMonth number, 2 digits (leading zeros)
bMonth name, lower case, 3 characters.
MMonth name, 3 characters.
FMonth name
dayjDay of the month
dDay of the month, 2 digits (leading zeros).
DDay name, 3 characters.
lDay name
zDay of the year (0 – 365)
wDay number of the week (0=Sunday, 6=Saturday).
misc.metainfotNumber of days in the given month.
LLeap year? (bool).
special formatsrRFC 2822 formatted date..
USeconds since the Unix Epoch (1970-01-01 00:00:00).
zDay of the year (0 – 365).
time zoneODifference to Greenwich time in hours.
ZTime zone offset in seconds. The offset for timezones west of UTC is always negative, and for those east of UTC is always positive..
TTime zone of this machine. (‘EST’, ‘MDT’).
English onlySEnglish ordinal suffix for day of the month (1st, 2nd)
PTime, in 12-hour hours, minutes and ‘a.m.’/'p.m.’, with minutes left off if they’re zero and the special-case strings ‘midnight’ and ‘noon’ if appropriate. Proprietary extension.
fTime, in 12-hour hours and minutes, with minutes left off if they’re zero. (Proprietary extension.)
NMonth abbreviation in Associated Press Style (proprietary extension).

Visit for more informations, contacts and news about Web Development.
See other blog posts at

Divhide purpose is to follow the HTML5 movement and contribute with applications which prove the quality of technology.

Feel free to contact divhide.