Adjusting timezone in MediaWiki

Adjusting timezone in MediaWiki

Posted by: Hofteigur
Posted on: 2007-03-08 21:27:00

I'm having a trouble getting my MediaWiki install to use the time zone of my choosing instead of the server's.

I've tried all the ides I think might apply from http://meta.wikimedia.org/wiki/Help:Timezone

This is the primary method I've tried:

In reply to:

#Set Default Timezone
$wgLocaltimezone = "Atlantic/Reykjavik";
$oldtz = getenv("TZ");
putenv("TZ=$wgLocaltimezone");
# Versions before 1.7.0 used $wgLocalTZoffset as hours.
# After 1.7.0 offset as minutes
$wgLocalTZoffset = date("Z") / 60;
putenv("TZ=$oldtz");



To which, and all other attempts recommended on that Wiki page, I get this error:

In reply to:

Parse error: syntax error, unexpected T_VARIABLE in /home/.genet/hofteigur/griffin-keep.net/w/LocalSettings.php on line 129



Where the line number applies to the first command, or "$wgLocaltimezone" in this instance.

Any ideas what causes this? I'd really like to see my own (and the other users') timezone when leaving signatures.

[Edited: code bbcode didn't work so I replaced it with quotes.]Edited by hofteigur on 03/08/07 09:31 PM (server time).

Re: Adjusting timezone in MediaWiki

Posted by: Hofteigur
Posted on: 2007-03-08 22:47:00

Well... seems this isn't the only problem I get.

These snippets should disable anonymous editing and creation of new users:

In reply to:

# This snippet prevents new registrations from anonymous users
# (Sysops can still create user accounts)
$wgGroupPermissions['*']['createaccount'] = false;

# This snippet prevents editing from anonymous users
$wgGroupPermissions['*']['edit'] = false;


Same error as above. Different line number of course...

Re: Adjusting timezone in MediaWiki

Posted by: Hofteigur
Posted on: 2007-03-09 18:59:00

Bah... both problems fixed by placing the snippets higher in the LocalSettings.php...

Re: Adjusting timezone in MediaWiki

Posted by: Tagberto
Posted on: 2007-09-22 18:27:00

Did you ever get a response or figure out what the problem was?

I've just setup a wiki and was trying to use those same commands to lock it down. I don't see any errors, but it isn't doing anything either.

Tags: default timezonetzwikimediamediawikiparse errorsyntax errorwikiserver timebbcodetime zonesignaturesmetaquotes