Change the Default date format
This How-to applies to:
Any version.
This How-to is intended for:
Integrators, Customizers
- Go to the Zope Management Interface (ZMI)
- Go to
/portal_properties/site_properties
There are two variables that control the date display, localTimeFormat and localLongTimeFormat. The second one normally includes the hours and minutes too.
Plone uses the standardized strftime date format specification known from the C programming language.
Let's say you want to change the from year-month-day (2005-01-17) to month day, year (January 17, 2005):
- Change
localTimeFormatto%B %d, %Y - Change
localLongTimeFormatto%B %d, %Y %H:%M— or%B %d, %Y %I:%M %pif you want to show time as AM/PM
Another example: We want to change the date format to DD.MM.YYYY (17.01.2005):
- Change
localTimeFormatto%d.%m.%Y - Change
localLongTimeFormatto%d.%m.%Y %H:%M
A full list of all the available format options can be found in the python time module documentation (search for strftime, about halfway).
Wrong date/time displaying on some pages in Plone 2.5.2 on Zope 2.9.6?
An example: I add an event, setting the date to be Thursday June 14, 2007 and the time to be noon to 1pm. On the page that is created for the event, the date and time display correctly. However, on views that display summary information about this event -- for instance a folder or a smartfolder listing the page -- the time displays (incorrectly) as 8 to 9am.
Is this a known bug, or do I need to change some settings somewhere?
Any advice appreciated - thanks.