Edit report at http://bugs.php.net/bug.php?id=54036&edit=1

 ID:                 54036
 Updated by:         der...@php.net
 Reported by:        antoine at arcantia dot com
 Summary:            Mktime issue  arround march 26th
-Status:             Open
+Status:             Bogus
 Type:               Bug
 Package:            *General Issues
 Operating System:   Linux
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 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:
------------------------------------------------------------------------
[2011-02-17 16:23:56] antoine at arcantia dot com

Description:
------------
Hi,



Mktime returns bad value when we worl on marchs date.

The diffrence bettween dates is wrong.

Test script:
---------------
<?



$du ="26/03/2011";

$au ="28/03/2011";



$duArr = explode("/", $du);

$auArr = explode("/", $au);



$hour = 0;//date("H");

                $minute = 0;//date("i");

                $second = 0;//date("s");

                $date1 =
mktime($hour,$minute,$second,intval($duArr[1]),intval($duArr[0]),intval($duArr[2]));

                $date2 =
mktime($hour,$minute,$second,intval($auArr[1]),intval($auArr[0]),intval($auArr[2]));



$diffDate = $date2 - $date1;

                $diffJours = floor($diffDate/(60*60*24));





echo $diffJours."<br>";



?>

Expected result:
----------------
Must return 2





Actual result:
--------------
Returning 1


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=54036&edit=1

Reply via email to