Date and Time formatting
Plone uses the message catalog to display time and date format depending on the user's language choice.
General Date and Time format
The localized_time method requires two special message ids present to work as designed. When these msgids are not translated for a language, the default strftime formatting as defined at the portal_properties sheet is used.
- Long time format
- msgid: date_format_long
- Short time format
- msgid: date_format_short
Both msgstrs support predefined variable names which have to be used inside the msgstr. These variables are the same as in the strftime formating, but tal style: Supported are %A, %B, %b, %H, %I, %m, %d, %M, %p, %S, %Y, %y, %Z. Variables not numbers (eg weekday and monthname) are passed to the translation service seperately. This means that each weekday / month name needs to be present as msgid as well (english).
Example and default
- msgid "date_format_long"
- msgstr "${Y}-${m}-${d} ${H}:${M}"
- msgid "date_format_short"
- msgstr "${Y}-${m}-${d}"