![]() |
sponsored links |
|
|
sponsored links
|
|
1
25th August 05:06
External User
Posts: 1
|
ID: 38392
Updated by: derick@php.net Reported By: pcdinh at gmail dot com -Status: Open +Status: Bogus Bug Type: Date/time related Operating System: Windows XP SP2 PHP Version: 5.1.4 New Comment: Use the correct timezone setting. Set date.timezone in php.ini according to one of the names from http://www.php.net/manual/en/timezones.php Previous Comments: ------------------------------------------------------------------------ [2006-08-09 05:12:57] pcdinh at gmail dot com 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 this bug report at http://bugs.php.net/?id=38392&edit=1 |
|
|