Swap ParserFuncs to use the timezone funcs (like r60825) rather than putenv() magic.

putenv( 'TZ=foo' ) doesn't work with the 5.4 beta ;-)
This commit is contained in:
Chad Horohoe 2011-09-29 18:20:10 +00:00
parent e764705f57
commit e188af9e04

View file

@ -481,14 +481,14 @@ class ExtParserFunctions {
if ( $local ) {
# Use the time zone
if ( isset( $wgLocaltimezone ) ) {
$oldtz = getenv( 'TZ' );
putenv( 'TZ=' . $wgLocaltimezone );
$oldtz = date_default_timezone_get();
date_default_timezone_set( $wgLocaltimezone );
}
wfSuppressWarnings(); // E_STRICT system time bitching
$ts = date( 'YmdHis', $unix );
wfRestoreWarnings();
if ( isset( $wgLocaltimezone ) ) {
putenv( 'TZ=' . $oldtz );
date_default_timezone_set( $oldtz );
}
} else {
$ts = wfTimestamp( TS_MW, $unix );