(bug 12815) Signature timestamps are now given in the time zone specified by
authorIlmari Karonen <vyznev@users.mediawiki.org>
Sat, 9 Feb 2008 20:39:32 +0000 (20:39 +0000)
committerIlmari Karonen <vyznev@users.mediawiki.org>
Sat, 9 Feb 2008 20:39:32 +0000 (20:39 +0000)
$wgLocaltimezone.  Formerly the timestamp itself was always in UTC, while the
timezone code in parentheses came from $wgLocaltimezone or, if unset, from
the server environment.

RELEASE-NOTES
includes/Parser.php

index 5444814..72c43f7 100644 (file)
@@ -376,6 +376,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   is disabled
 * (bug 12869) Magnify icon alignment should be adjusted using linked CSS
 * Fixing message cache updates for MediaWiki messages moves
+* (bug 12815) Signature timestamps were always in UTC, even if the timezone code
+  in parentheses after them claimed otherwise
 
 == Parser changes in 1.12 ==
 
index 85864cd..1549069 100644 (file)
@@ -3657,16 +3657,20 @@ class Parser
                 * the database, we use $wgContLang here in order to give
                 * everyone the same signature and use the default one rather
                 * than the one selected in each user's preferences.
+                *
+                * (see also bug 12815)
                 */
+               $ts = $this->mOptions->getTimestamp();
+               $tz = 'UTC';
                if ( isset( $wgLocaltimezone ) ) {
+                       $unixts = wfTimestamp( TS_UNIX, $ts );
                        $oldtz = getenv( 'TZ' );
                        putenv( 'TZ='.$wgLocaltimezone );
-               }
-               $d = $wgContLang->timeanddate( $this->mOptions->getTimestamp(), false, false) .
-                 ' (' . date( 'T' ) . ')';
-               if ( isset( $wgLocaltimezone ) ) {
+                       $ts = date( 'YmdHis', $unixts );
+                       $tz = date( 'T', $unixts );  # might vary on DST changeover!
                        putenv( 'TZ='.$oldtz );
                }
+               $d = $wgContLang->timeanddate( $ts, false, false ) . " ($tz)";
 
                # Variable replacement
                # Because mOutputType is OT_WIKI, this will only process {{subst:xxx}} type tags