Personal tools
You are here: Home Development Teams i18n Team Date and Time formatting
Document Actions

Date and Time formatting

by Alexander Limi last modified June 15, 2005 - 20:53

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}"

For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by