Question
I too have a question regarding Time Zone.
Where should I change the Time Zone Settings and What Value should I give considereing the act that I am in India and the Time Zone Difference is GMT+05:30
Answer
Please Post your Answer here
Question
All time stamps in TWiki are displayed in GMT. How can I change this to my local time zone?
--
JonReid - 27 Jun 2001
Answer
This is currently not supported. TWiki is typically used by corporations with offices around the world, so GMT makes sense in that kind of environment. A future version might support individualized time zones.
--
PeterThoeny - 28 Jun 2001
Pout
While I agree that the GMT times must be standard for international use, I urge you to consider the way that TWiki is being used in more typical corporations in other parts of the world.
On an intranet such as ours and many others, the forced GMT problem is enough
on its own to can the project, totally. I am trying to set up TWiki for an organisation which by definition is local to one city and therefore one timezone, yet could potentially have hundreds or thousands of internal TWiki users. They will not be partaking in idle chat, but recording important work observations and documentation items, for which the time is critical in some cases. TWiki is ideal for the task, but records wrong looking times which we cannot use.
I strongly agree that GMT should be enforced by default, but for intranet use there should be a readily configurable option to use the company's local time for everything. We definitely don't need the added complexity of individualised time zones. We just need one time, OUR time.
Is the unconfigurable base GMT requirement ever likely to change? Is it something that would be technically too difficult to change without destroying much else, or is it more an idealogical issue?
--
SueBlake - 13 Jul 2002
(To me it's Jul 14 00:48:37 EST 2002 but that's no problem at all, because
this web is international)
Alternative
I just did a read of
SettingCorrectTimeZone, are you willing to tweak your programs?
--
DrewCard - 13 Jul 2002
Thanks! Willing, but not so sure about able :-). I'll have a go. SERVERTIME which someone mentioned sounds logical but I'm not sure yet where it fits in to all this, so I'll just make the basic changes outlined by
CoreyFruitman in
SettingCorrectTimeZone.
It would be really nice to have the changes more automated one day, like a single patch(1) file or a config option, but for now if I can just get this working it'll be a lot more usable. And those changes look much easier to achieve than my current task of removing all the time and date displays.
--
SueBlake - 14 Jul 2002
What about using the "more official" term
UTC rather than
GMT
and making the ISO date format the default? I found references
through the code to
changeToIsoDate but it doesn't appear to be
set anywhere.
I also wondered about the use of the POSIX library function
strftime which should be present on all PERL installations
rather than the somewhat home brew
sprintf calls for date
formatting. What's the procedure to submit patches? Is TWiki
CVS'd?
--
KurtAndersen - 13 Nov 2002
UTC is similar to GMT, but the latter is of course very well known. If you say UTC to most people, you get blank looks. What would be more widely applicable is to support a configurable server timezone, which has come up a few times (see
TWikiPatches). Similarly, ISO date format is fine for other people but not for others, and should ideally be configurable. The current format has the advantage of being easily understood by English speakers in the UK, US and elsewhere.
sprintf is part of the Perl language, whereas
strftime would
need us to use the POSIX module
, so unless the latter has a big advantage I think sprintf will stay for now. Of course, if the POSIX module helps in configurable timezones etc that could change things, but the number of modules loaded by TWiki is quite a concern, see
ModPerl and
CacheAddOn.
--
RichardDonkin - 13 Nov 2002
Work on
InternationalisationEnhancements at the moment means that TWiki sites that have working locale setups will ultimately end up loading the POSIX module anyway (though sites that don't care about this won't pay the module loading penalty).
The
POSIX::strftime function would greatly help with internationalised dates, now I've looked at it - sorry for rebuffing that suggestion

For example, here's the output of
strftime in some different locales, on Debian Linux with working locales (YMMV especially for Perl on Windows!):
[fud:rdonkin]$ LANG=en_US.ISO8859-1
[fud:rdonkin]$ TZ=PST8PDT
[fud:rdonkin]$ perl -we 'use POSIX; @a= localtime; print strftime "%c\n", @a'
Wed 27 Nov 2002 04:37:51 AM PST
[fud:rdonkin]$ TZ=EST5EDT
[fud:rdonkin]$ perl -we 'use POSIX; @a= localtime; print strftime "%c\n", @a'
Wed 27 Nov 2002 07:38:05 AM EST
[fud:rdonkin]$ LANG=sv_SE.ISO8859-1
[fud:rdonkin]$ perl -we 'use POSIX; @a= localtime; print strftime "%c\n", @a'
ons 27 nov 2002 07.38.40
The
%c format in
POSIX::strftime says 'use the preferred local time format', and takes account of timezones. My only caveat is that it doesn't always include the timezone so might need some work on non-US locales to make this really clear - but then if the users are all within a single timezone it's not a big issue, you just set it to that TZ.
To answer
KurtAndersen's original question: patches are very welcome, please see
PatchGuidelines for the details. As long as the patches solve a general problem and are good quality, they have a good chance of being included in the core. If not, they can just be listed on
TWikiPatches so that those who are interested can apply them.
--
RichardDonkin - 27 Nov 2002
More Pout, Rant
Well, I'm implementing TWiki at a 70 billion dollar company, which has
offices all over the United States, but which has
all current and potential users of TWiki located in its home offices in
ONE time zone, and
0 international offices. I would bet dollars to doughnuts that
many large international companies want to use TWiki in contexts like IT departments which operate only within
ONE time zone. This kind of thing is fine actually for developers, they would be happy with <ISO8601>2003-05-21T01:21:00Z</ISO8601>, but our business users do not want to mentally figure out daylight savings time offsets from GMT. I think it is important for there to be a simple TWikiPreferences option to display (at display time, not internally) times in localtime. For us, UTC in our TWiki is just a hassle to try to patch... I tried the gmtime->localtime change, with unsatisfactory results, and am not willing to dive into the various other bits in
SettingCorrectTimeZone yet, I guess I would like it blessed...
--
TomOehser - 2003-05-21T10:27:00-0400 (not Romeo Time, Quebec Time, in the summer)
I agree this is something that affects most users of TWiki.
SettingCorrectTimeZone is almost always in the top 10 on
WebStatistics, showing there's some demand for this. We already load the POSIX module when using
InternationalisationEnhancements, so there's no installation overhead.
It may not be that hard to do, but rather like the
I18N work it's a bit grungy involving lots of detailed changes. If someone can produce a suitable patch that is
configurable (i.e. there's a TWiki.cfg variable to say what timezone to use), that would help move things along - following
PatchGuidelines would help a lot as well. I don't think relying on locales is a good idea - unfortunately they are broken on many servers, but some testing is required. As long as it can run on systems where the only locale is "C" we should be OK.
--
RichardDonkin - 21 May 2003
I agree that Locales are probably not the answer. If, as I suspect, locales are a server-wide setting using it would not satisfy users who run TWiki on a shared hosting provider. See
CalendarPluginDev for an example of where I use the same server in the US to serve two distinct communities - one in the UK and the other in Australia. I was fortunate enough in that case to find a developer who cared enough to add a timezone parameter.
--
MartinCleaver - 21 May 2003
Locales can be set on a per-user basis in general, it's just that for TWiki it would complicate matters by introducing different character sets in a single site, so this is not supported. In any case, running the commands listed above on
CygWin show that
strftime is not really an option - due to lack of working locales on Cygwin, this doesn't work.
Per-user timezone settings would be very useful, particularly for international companies, but to make this work TWiki really needs to bite the bullet and have built-in (configurable) support for cookie-based user identification - not necessarily authentication, just a way of knowing in the
view script who is viewing the page so that their preferences can be applied. The
UserCookiePlugin is a start but we'd need this to be built-in and not just used for authentication.
To do this properly, we would really need to handle daylight savings time (DST), which in turn requires the user to pick their location (country) not just timezone. Working locales would make this so much simpler - you just feed in the user's current locale (minus the character set), e.g.
de_AT for Austria (AT), and out pops the current time, taking account of DST.
A simpler option is to just use the TWiki server's
localtime for everyone - this is either correctly set up (on Unixes, which typically run in UTC but display in local time) or set to machine time (on Windows, i.e server just always shows the machine's local time). I don't really like this option - we might as well do something more flexible if we are going to the effort of updating this code.
Some useful resources in this area - the Perl TimeDate distribution looks like an interesting option for the non-locale route:
This may explain why nobody has really addressed this area properly - it's pretty complex
--
RichardDonkin - 23 May 2003
AlwaysServerTimeZone has been implemented in the
CairoRelease to allow you to set either gmttime or servertime in the
TWikiDotCfg. This will change values that use the %DISPLAYTIME% variable. (including the templates)
--
SvenDowideit - 21 Apr 2004
The US is changing its daylight savings time switchover date for spring, from 2007 onwards - see this
blog posting
. This is a good reason to use CPAN modules to solve this, which of course should be driven by authoritative and frequently updated timezone data files, as with Unix/Linux systems.
--
RichardDonkin - 28 Oct 2005
I see this as one of the few remaining important outstanding issues in TWiki. It should be possible for an administrator to set a default timezone to be displayed to guests. And each user should be able to set a timezone on their user page using a TWiki variable (e.g.
* Set TIMEZONE = Pacific/Auckland). The
DateTime
modules may be ideal for this.
Ultimately, having timezone support will make this a truly collaborative platform for users all over the world. The
Perlmonks
website has support for every user to be in a different timezone. It is convenient and means users don't have to do mental calculations as to when a page actually got updated/changed.
If I get time one day I'll look into the source myself, but I think this feature should be standard in TWiki v5.0.
--
PeterPayne - 17 Oct 2006