Vous êtes ici : Accueil » Community » Timezone

Timezone



Post  Timezone
Auteur: David Achterberg  Send Email
Date: 02/06/2004 03:06


Maybe this is obvious, but how can I get the time to display for my location?




Réponses: Trié par [Date] [Auteur] [Sujet]

  Re:Timezone (zyon - 02/06/2004 08:06)

First way : On a plone site, go to ZMI and check the "LocalTimeFormat" and "LocalLongTimeFormat" properties inside "portal_properties/site_properties".

Second way : You can modify the DateTime format with this method "mydatetimeobject.strftime(myformat)". Check the "help" link in ZMI for more informations about "DateTime" objects.

 Re:Re:Timezone (David Achterberg - 04/06/2004 06:06)

First way: By "checked" do you mean check the box to the left? I believe that is only available to delete a property. I have already formatted this field to display the date in the format I want. What do I need to enter some other value to change the timezone? If so, an example would help. The ZMI help is difficult at best to understand.

  Re:Timezone (zyon - 04/06/2004 10:06)

Oups sorry, check = look at ;-)

So if you had already formatted these fields, use the python scripts "toLocalizedTime" or "toPortalTime" to display a DateTime object with the good format.

use them like this inside the tal code :

tal:content="python:here.toLocalizedTime(datetime_object)"

 Re:Re:Timezone (Jarrold - 15/12/2004 10:12)

Here is a similar way to get your plone instance to show the correct timezone:

customize /portal_skins/plone_scripts/toLocalizedTime to look like this:

#given a time string convert it into a DateTime and then format it appropriately #use time format of translation service from Products.CMFPlone.PloneUtilities import localized_time t = DateTime(str(time)) svTime = DateTime.toZone(t,US/Pacific) return localized_time(svTime, long_format, context)

Change US/Pacific to the timezone you want. For the calendar to show the correct date you have to edit the following:

/portal_skins/plone_portlets/portlet_calendar

change all occurances of DateTime() to DateTime(US/Pacific)

 Re:Re:Re:Timezone (Alex - 16/03/2005 08:03)

This fix breaks my site. "NameError: global name US is not defined"

Did I misunderstand its supposed to say US/Pacific Where can I define the timezone?

  Re:Timezone (George from zebra print dress - 12/05/2012 16:05)

I second that... George, a href="http://www.squidoo.com/zebra-print-dress">http://www.squidoo.com/zebra-print-dress