ID: 20113 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Bogus Bug Type: Date/time related Operating System: linux PHP Version: 4.2.2 New Comment:
We are happy to tell you that you just discovered Daylight Savings Time. For more information see: http://webexhibits.org/daylightsaving/b.html Instead of using mktime/date consider using gmmktime and gmdate which do not suffer from DST. Previous Comments: ------------------------------------------------------------------------ [2002-10-26 20:53:04] [EMAIL PROTECTED] hi, it seems that time() doens't work correctyl, either in mysql or php, but i thinks it's php. may be aynone can verify this ? test-code: // check timestamps... $t1 = time(); $sql = $theApp->sql->select_row("NOW() as t, UNIX_TIMESTAMP(NOW()) as s"); $t2 = $sql['s']; $sqlt = $sql['t']; error_log("php: $t1, mysql: $t2, dif: ".($t2-$t1).", php-time: ".date("H:i:s").", sql-time: ".$sqlt); outputs: php: 1035683199, mysql: 1035679599, dif: -3600, php-time: 02:46:39, sql-time: 2002-10-27 02:46:39 as you can see, the date reported is the same but the timestamp exactly differs one hour. i think this is because of summer/winter time, but im not sure. so either mysql or php returns wrong timestamp !! ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=20113&edit=1