Account for wgDBtimezone if set. DBs not using it (mysql) will have it = 0 and return...
authorGreg Sabino Mullane <greg@users.mediawiki.org>
Mon, 26 Mar 2007 02:32:33 +0000 (02:32 +0000)
committerGreg Sabino Mullane <greg@users.mediawiki.org>
Mon, 26 Mar 2007 02:32:33 +0000 (02:32 +0000)
includes/GlobalFunctions.php

index dedd361..6207047 100644 (file)
@@ -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],