This question about Configuration: Answered

configuring dates/times to reflect multiple timezones

I'm trying to make all the dates in my FOSWiki relevant to users from many timezones by showing dates in the local timezone of person accessing the site wherever possible.

  1. Firstly - what is the best approach to achieve this goal?
  2. Secondly - what I'm doing at the moment is using the LocalTimePlugin and configuring %LOCALTIMEPLUGIN_TIMEZONE% in each user topic to match their location. Then I pass each date instance appearing on my wiki pages through the %LOCALTIME{...}% first.

    The thing I can't work out is: what happens in date macros from skin templates? For example attachtables.tmpl uses the %A_DATE% is the local time variable available to the template? I notice it always shows as the LocalSite.cfg {DisplayTimeValues} value even when you say %LOCALTIME{datetime="%A_DATE%"}% in the template.

    I assume the skin template macros are processed before the user topic variables are processed.
Any suggestions? Ways I could get timezones available to templates on a per-user basis?

-- HughBlair 20thJune 2011

On further investigation it looks like the problem was on the my side. Once I configured in LocalSite.cfg the $Foswiki::cfg{DefaultDateFormat} to match something that %LOCALTIME{datetime="%A_DATE%"}% could interpret, then everything was ok configured from the template. I hope this doesn't break something else. I'm not sure if this question should have a Status of "marked for deletion" or "answered" (considering I answered my own question).

-- HughBlair 20thJune 2011

"Answered" is fine. You were just lucky that someone who knew the answer came along! wink

-- CrawfordCurrie - 20 Jul 2011

QuestionForm edit

Subject Configuration
Extension LocalTimePlugin
Version Foswiki 1.1.3
Status Answered
Related Topics
Topic revision: r3 - 20 Jul 2011, CrawfordCurrie
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy