#38392 [NEW]: date() return result that is different from mysql's now()

From: Date: Wed, 09 Aug 2006 05:12:58 +0000
Subject: #38392 [NEW]: date() return result that is different from mysql's now()
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-100560@lists.php.net to get a copy of this message
From: pcdinh at gmail dot com Operating system: Windows XP SP2 PHP version: 5.1.4 PHP Bug Type: Date/time related Bug description: date() return result that is different from mysql's now() Description: ------------ PHP 5.1.4 and PHP 5.2 RC2 dev return different time compared with mysql's now() and local time. Default config Reproduce code: --------------- Local server in PC: MySql 5.0.22, PHP 5.1.4, PHP 5.2 RC2 dev, PHP 4.4.1 PHP 5.1 and 5.2 echo date("h:i:s"); // return 01:06:49 echo date("h:i:s", time()); // return 01:06:49 PHP 4.4.1 echo date("h:i:s"); // return 12:06:49 echo date("h:i:s", time()); // return 12:06:49 MYSQL (5.0.22) Query: select now(); // return 2006-08-09 12:06:49 Local time: 12:06:49 Expected result: ---------------- PHP 5.1 and 5.2 echo date("h:i:s"); // return 01:06:49 (expected 12:06:49) echo date("h:i:s", time()); // return 01:06:49 (expected 12:06:49) PHP 4.4.1 echo date("h:i:s"); // return 12:06:49 (expected 12:06:49) echo date("h:i:s", time()); // return 12:06:49 (expected 12:06:49) MYSQL (5.0.22) Query: select now(); // return 2006-08-09 12:06:49 ((expected 12:06:49)) Local time: 12:06:49 Actual result: -------------- PHp 5 automatically add 1 hour to the actual time on the local server. -- Edit bug report at http://bugs.php.net/?id=38392&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38392&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38392&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38392&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=38392&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=38392&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=38392&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=38392&r=needscript Try newer version: http://bugs.php.net/fix.php?id=38392&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=38392&r=support Expected behavior: http://bugs.php.net/fix.php?id=38392&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=38392&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=38392&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=38392&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38392&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=38392&r=dst IIS Stability: http://bugs.php.net/fix.php?id=38392&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=38392&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=38392&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=38392&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=38392&r=mysqlcfg

« previous php.bugs (#100560) next »