Author: lila-pather
Description:
Hi,
{{CURRENTTIME}} and {{CURRENTTIMESTAMP}} shows the wrong server time. The
problem is in the file 'includes/Parser.php'. This variables are filled by the
function 'wfTimestamp()' with 'gmmkdate()' which returns a date of GMT, but my
server is in germany (GMT +02:00). All other variables e.g. CURRENTDAY are
filled by normal date function which return the correct server time.
Example:
local server time: 09/09/2006 0:30
{{CURRENTTIME}} = 22:30 - wrong
{{CURRENTDAY}} = 9 - right
{{CURRENTMONTH}} = 09 - right
Fix in the Parser.php
case MAG_CURRENTTIME:
- return $varCache[$index] = $wgContLang->time( wfTimestamp( TS_MW, $ts ),
false, false );
+ return $varCache[$index] = $wgContLang->time( date( 'YmdHis', $ts ), false,
false );
case MAG_CURRENTTIMESTAMP:
- return $varCache[$index] = wfTimestampNow();
+ return $varCache[$index] = date( 'YmdHis', $ts );
The same problem is on the user preferences.
Fix in the SpecialPreferences.php
- $nowserver = $wgLang->time( $now, false );
+ $nowserver = $wgLang->time( date( 'YmdHis', time() ), false );
Version: unspecified
Severity: trivial