Setting up Plone to show Dubai time

As a short introduction, Plone is an excellent content and document management system. I would not insist on its features and installation as it installs as a normal Mac OS X application. For this, you may find more visiting Plone.org website.

In exchange, I will present the issue I had with the timezone for Dubai and the workaround…

For some reason, the default Plone installation doesn’t pick the right time for Asia/Dubai.

So I googled back and forward but couldn’t find the correct answer.

In fact, those tips will work for something like Europe/Berlin (eg setting up TZ variable to Europe/Berlin), but setting up TZ environment variable to Asia/Dubai will give me something like GMT+10? Obviously wrong.

So, the workaround is to set up the TZ environment variable to something more general, like Etc/GMT+4. We don’t care about daylight saving issues, so it should work all year round.

Enough words, let me know show you some code. Let’s suppose that you downloaded version 3.2.2 from http://plone.org/products/plone for Mac OS X and used the Stand Alone installation, then, edit /Applications/Plone/zinstance/buildout.cfg file and locate the following lines under [instance] section:

# You may also control the environment variables for the instance.
environment-vars =
    PYTHON_EGG_CACHE ${buildout:directory}/var/.python-eggs

Now add the TZ environment variable to point to Etc/GMT+4:

# You may also control the environment variables for the instance.
environment-vars =
    PYTHON_EGG_CACHE ${buildout:directory}/var/.python-eggs
    TZ Etc/GMT+4

Save the file, then run from your Terminal:

cd /Applications/Plone/zinstance/
./bin/plonectl stop
./bin/buildout
./bin/plonectl start

Now, back in your favourite browser and launch http://localhost:8080/Plone.

You would see now, that Plone will report the correct time.

Leave a Reply

Twitter Comments message