#27797 [Opn->Bgs]: date function wrongly convert timestamps

From: Date: Wed, 31 Mar 2004 12:43:59 +0000
Subject: #27797 [Opn->Bgs]: date function wrongly convert timestamps
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-57216@lists.php.net to get a copy of this message
ID: 27797 Updated by: derick@php.net Reported By: ercanaydemir at hotmail dot com -Status: Open +Status: Bogus Bug Type: Date/time related Operating System: Linux PHP Version: 4.3.4 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php This is working just fine. You pass a DST date while forcing to say that the date is not in DST; thus PHP adds an hour. Previous Comments: ------------------------------------------------------------------------ [2004-03-31 06:45:39] ercanaydemir at hotmail dot com Description: ------------ The following example is relevant. Two dates but with the same hour. Using the date function with the "G" option gives different results even if the hours are the same. Reproduce code: --------------- <? $D = mktime(0,0,0,3,29,2004,0); $DM1 = mktime(0,0,0,3,28,2004,0); echo "$D<br>$DM1<br>"; $Hour = date("G",$D); $HourM1 = date("G",$DM1); echo "$Hour<br>$HourM1"; ?> Expected result: ---------------- 0 0 Actual result: -------------- 1 0 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27797&edit=1

« previous php.bugs (#57216) next »