Author: achuggard
Description:
At the beginning of function pstPass2 in Parser.php we have the following code. Effective as of around revision 30106:
if ( isset( $wgLocaltimezone ) ) { $oldtz = getenv( 'TZ' ); putenv( 'TZ='.$wgLocaltimezone ); } $d = $wgContLang->timeanddate( $this->mOptions->getTimestamp(), false, false) . ' (' . date( 'T' ) . ')'; if ( isset( $wgLocaltimezone ) ) { putenv( 'TZ='.$oldtz ); }
The issue with this is that if $wgLocaltimezone is set, $this->mOptions->getTimestamp() seems to return a cached UTC timestamp, while date( 'T' ) returns a the TimeZone abbreviation coordinated with $wgLocaltimezone.
Example, my $wgLocaltimezone is set to "America/Chicago" if I used ~~~~~ in a page at 23:19 Central today (27 January), my timestamp is reported as "05:19, 28 January 2008 (CST)"
An off the cuff suggestion for solving this is the following:
if ( isset( $wgLocaltimezone ) ) { $oldtz = getenv( 'TZ' ); putenv( 'TZ='.$wgLocaltimezone ); $dtz = date( 'YmdHis' ); } else { $dtz = $this->mOptions->getTimestamp(); } $d = $wgContLang->timeanddate( $dtz , false, false) . ' (' . date( 'T' ) . ')'; if ( isset( $wgLocaltimezone ) ) { putenv( 'TZ='.$oldtz ); }
Version: 1.12.x
Severity: normal