Opened 15 years ago
Closed 15 years ago
#13289 closed (fixed)
datetime filter
Reported by: | zach | Owned by: | nobody |
---|---|---|---|
Component: | Template system | Version: | 1.1 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
In addition to the date filter which by default formats to settings.DATE_FORMAT, there should be a datetime filter which formats to settings.DATETIME_FORMAT.
Note:
See TracTickets
for help on using tickets.
Yo can pass Python
datetime
s to thedate
filter, and if you use a format string containing time of day format specifiers you can get a complete date+time representation.If you need to use a predefined format specification like
DATETIME_FORMAT
then the new in 1.2 l10n machinery allows you to use format strings defined per-locale and fallback to settings values likesettings.DATETME_FORMAT
. Read the relevant docs for more details.This won't be backported to the 1.1.X branch where no new feature can be added so if are using 1.1 you need to use the
DATETIME_FORMAT
I'd advise you to plan porting you application to 1.2.