From 916fab6eb58da78bf08bf646c9856498ca4aca3a Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Sun, 30 Apr 2006 12:20:20 +0000 Subject: [PATCH] =?utf8?q?Fix=C2=A0#5191:=20$wgLocalTZoffset=20rounds=20ti?= =?utf8?q?me=20zones=20half=20an=20hour=20ahead=20of=20UTC?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- UPGRADE | 4 ++++ includes/DefaultSettings.php | 6 +++--- languages/Language.php | 6 +++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/UPGRADE b/UPGRADE index bec8c55002..0a8e9333e5 100644 --- a/UPGRADE +++ b/UPGRADE @@ -73,6 +73,10 @@ procedure, and especially after upgrading; check that page views and edits work normally and that special pages continue to function, etc. and correct errors and quirks which reveal themselves. +== Upgrading from 1.6 wikis == + +$wgLocalTZoffset was in hours, it is now using minutes. + == Upgrading from pre-1.5 wikis == Major changes have been made to the schema from 1.4.x. The updater diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index ecf82424fb..22b4944035 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1654,21 +1654,21 @@ $wgBrowserBlackList = array( $wgLocaltimezone = null; /** - * Set an offset from UTC in hours to use for the default timezone setting + * Set an offset from UTC in minutes to use for the default timezone setting * for anonymous users and new user accounts. * * This setting is used for most date/time displays in the software, and is * overrideable in user preferences. It is *not* used for signature timestamps. * * You can set it to match the configured server timezone like this: - * $wgLocalTZoffset = date("Z") / 3600; + * $wgLocalTZoffset = date("Z") / 60; * * If your server is not configured for the timezone you want, you can set * this in conjunction with the signature timezone and override the TZ * environment variable like so: * $wgLocaltimezone="Europe/Berlin"; * putenv("TZ=$wgLocaltimezone"); - * $wgLocalTZoffset = date("Z") / 3600; + * $wgLocalTZoffset = date("Z") / 60; * * Leave at NULL to show times in universal time (UTC/GMT). */ diff --git a/languages/Language.php b/languages/Language.php index 47753e6ce0..70ca629768 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -527,7 +527,11 @@ class Language { $hrDiff = 0; if ( $tz === '' ) { - $hrDiff = isset( $wgLocalTZoffset ) ? $wgLocalTZoffset : 0; + # Global offset in minutes. + if( isset($wgLocalTZoffset) ) { + $hrDiff = $wgLocalTZoffset % 60; + $minDiff = $wgLocalTZoffset - ($hrDiff * 60); + } } elseif ( strpos( $tz, ':' ) !== false ) { $tzArray = explode( ':', $tz ); $hrDiff = intval($tzArray[0]); -- 2.20.1