Manual:$wgLocalTZoffset
| Timezone settings: $wgLocalTZoffset | |
|---|---|
| Add a distance to the server timezone in Minutes. |
|
| Introduced in version: | pre 1.1.0 |
| Removed in version: | still in use |
| Allowed values: | numeric or null |
| Default value: | null |
Other settings: Alphabetical | By Function
Contents |
[edit] Details
Set an offset from UTC in hours to use for the default timezone setting for anonymous users and new user accounts. Also used for users who set the corresponding text field in their preferences to an empty string. 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.
Leave at NULL to show times in universal time (UTC/GMT), or specify an offset in minutes (note that before 1.7.0 this parameter was in hours).
Warning: Changing this parameter during runtime may result in server crash (apache on windows).
[edit] Examples
[edit] 1.7.0 and higher
To avoid problems with daylight saving time, you can have PHP calculate the offset for you:
$wgLocaltimezone = 'CET'; $wgLocalTZoffset = date("Z") / 60;
[edit] Pre 1.7.0
Before 1.7, $wgLocalTZoffset was interpreted as hours, not minutes, so you'll need:
$wgLocalTZoffset = date("Z") / 3600;
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;
[edit] See also
| Language: | English • Français • 日本語 |
|---|