ID: 44536
Updated by: [EMAIL PROTECTED]
Reported By: anas1305 at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Date/time related
Operating System: XP and Linux
PHP Version: 5.2CVS-2008-03-26
New Comment:
Congratulations! You have found the DST (daylight saving time) and it's
problems. :) Hint: Use gmmktime() instead and you'll never encounter
this in the future.
Previous Comments:
------------------------------------------------------------------------
[2008-03-26 11:28:22] anas1305 at gmail dot com
Description:
------------
function return wrong result between 2 dates 2008-03-30 -> 2008-03-31.
PHP version : 5.2.3
Reproduce code:
---------------
$ddebut = "2008-03-30";
$dfin = "2008-03-31";
$tab_ddebut = explode("-", $ddebut);
$tab_dfin = explode("-", $dfin);
$timestamp_ddebut = mktime(0, 0, 0, $tab_ddebut[1], $tab_ddebut[2],
$tab_ddebut[0]);
$timestamp_dfin = mktime(0, 0, 0, $tab_dfin[1], $tab_dfin[2],
$tab_dfin[0]);
echo abs(($timestamp_dfin - $timestamp_ddebut)/86400);
Expected result:
----------------
this code abs(($timestamp_dfin - $timestamp_ddebut)/86400) return wrong
result : 0.958333333333. the correct result is 1.
Actual result:
--------------
0.958333333333
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44536&edit=1