Jump to content

Handbuch:Zeitzone

From mediawiki.org
This page is a translated version of the page Manual:Timezone and the translation is 27% complete.
Outdated translations are marked like this.

This page is about configuring the default Timezone (tz) for users who have not specified a custom offset in their preferences.

The timezone is used in the following places:

  • signatures
  • Zeitstempel in den letzten Änderungen
  • Zeitstempel in der Versionsgeschichte

Default value

The default value is taken from the web server configuration in the "php.ini" file.

See the documentation on PHP.net for the date.timezone configuration option

Configuration

Local timezone

  • Setze den $Localtimezone Wert auf einen geeigneten Wert welchen man hier finden kann.
Example
$wgLocaltimezone = "Australia/Sydney";

Timezone offset

Defining the timezone offset with configuration parameter $wgLocalTZoffset is usually not required.

Timecorrection

The time correction is set with configuration parameter $wgDefaultUserOptions and preference name "timecorrection". It respects the calculated offset and timezone dynamically. It applies to anonymous users and new user accounts which have not changed their preferences.

Value
$wgDefaultUserOptions['timecorrection'] = 'ZoneInfo|0|' . $wgLocaltimezone;

ZoneInfo, as MediaWiki's identifier for this timezone format, handles everything dynamically, i.e., MediaWiki calculates the correct offset based on the given timezone. The configuration defines a fixed pattern that does not change no matter which timezone is set for the wiki. See the examples below.

Examples

Australia/Sydney
$wgLocaltimezone = 'Australia/Sydney';
$wgDefaultUserOptions['timecorrection'] = 'ZoneInfo|0|' . $wgLocaltimezone;
America/Buenos_Aires
$wgLocaltimezone = 'America/Buenos_Aires';
$wgDefaultUserOptions['timecorrection'] = 'ZoneInfo|0|' . $wgLocaltimezone;
Europe/Berlin
$wgLocaltimezone = 'Europe/Berlin';
$wgDefaultUserOptions['timecorrection'] = 'ZoneInfo|0|' . $wgLocaltimezone;

See also