Manual:$wgLocaltimezone

From MediaWiki.org
Jump to: navigation, search
Timezone settings: $wgLocaltimezone
Fake out the timezone that the server thinks it's in.
Introduced in version: 1.4.0
Removed in version: still in use
Allowed values: string or null
Default value: null

Other settings: Alphabetical | By Function


Details [edit]

Note: The information in this article is out of date. Please refer to Manual:Timezone for more information.

Fake out the timezone that the server thinks it's in. This will be used for date display and not for what's stored in the DB. Leave to null to retain your server's OS-based timezone value. This is the same as the timezone. Examples:

 $wgLocaltimezone = 'GMT';
 $wgLocaltimezone = 'EST';
 $wgLocaltimezone = 'EST8'; ## -6 hrs instead of -5
 $wgLocaltimezone = 'PST8PDT';
 $wgLocaltimezone = 'Asia/Bangalore';
 $wgLocaltimezone = 'CET';

Implementation [edit]

As of MediaWiki 1.9.3, in source file includes/Parser.php, variable $wgLocaltimezone is used by function pstPass2() which performs various pre-save transformations, including the expansion of signature macros ~~~~ and ~~~~~; and by function getVariableValue() which is called by function variableSubstitution() which handles expansion of wiki syntax such as {{subst:CURRENTTIME}} as described at Meta:Help:Variable#Substitution.

The later code path appears to be in conflict with the code comment in DefaultSettings.php which states:

* This variable is currently used ONLY for signature formatting, not for
* anything else.

Another potential discrepancy is that pstPass2() obtains the adjusted current date via the function $wgContLang->timeanddate() while getVariableValue() obtains the adjusted date by calling date() directly.

See also [edit]

Language: English  • français • 日本語 • русский