Bug #54036 [NEW]: Mktime issue arround march 26th

From: Date: Thu, 17 Feb 2011 15:23:59 +0000
Subject: Bug #54036 [NEW]: Mktime issue arround march 26th
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-158826@lists.php.net to get a copy of this message
From:             
Operating system: Linux
PHP version:      Irrelevant
Package:          *General Issues
Bug Type:         Bug
Bug description:Mktime issue  arround march 26th

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 bug report at http://bugs.php.net/bug.php?id=54036&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=54036&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=54036&r=trysnapshot53
Try a snapshot (trunk):              http://bugs.php.net/fix.php?id=54036&r=trysnapshottrunk
Fixed in SVN:                        http://bugs.php.net/fix.php?id=54036&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54036&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=54036&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=54036&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=54036&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=54036&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=54036&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=54036&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=54036&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=54036&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=54036&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=54036&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=54036&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=54036&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=54036&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=54036&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=54036&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=54036&r=mysqlcfg



Thread (2 messages)

« previous php.bugs (#158826) next »