From: Greg Sabino Mullane Date: Mon, 26 Mar 2007 02:32:33 +0000 (+0000) Subject: Account for wgDBtimezone if set. DBs not using it (mysql) will have it = 0 and return... X-Git-Tag: 1.31.0-rc.0~53605 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=96c5543647d84a27479bb95511eeec41c73c3ff1;p=lhc%2Fweb%2Fwiklou.git Account for wgDBtimezone if set. DBs not using it (mysql) will have it = 0 and return same time as always. --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index dedd361913..620704739d 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1317,7 +1317,7 @@ function wfArrayLookup( $a, $b ) { */ function wfTimestampNow() { # return NOW - return wfTimestamp( TS_MW, time() ); + return wfTimestamp( TS_MW, 0 ); } /** @@ -1404,10 +1404,11 @@ define('TS_POSTGRES', 7); * @return string Time in the format specified in $outputtype */ function wfTimestamp($outputtype=TS_UNIX,$ts=0) { + global $wgDBtimezone; $uts = 0; $da = array(); if ($ts==0) { - $uts=time(); + $uts=time() - 60*60*$wgDBtimezone; } elseif (preg_match('/^(\d{4})\-(\d\d)\-(\d\d) (\d\d):(\d\d):(\d\d)$/D',$ts,$da)) { # TS_DB $uts=gmmktime((int)$da[4],(int)$da[5],(int)$da[6],