From: siddarth at revolutesolution dot com
Operating system: Linux
PHP version: 5.2.6
PHP Bug Type: Unknown/Other Function
Bug description: mktime giving strange problem
Description:
------------
Hi,
I am making a counting system, which will told visitor to a days
difference within selected date range.
If user enter date till 2038 it works fine..and user enter beyond then
this, then it start giving error (negative values)
I read that due to PHP version problem it did, but we have "PHP Version
5.2.5" installed on the server.
Can you please suggest about this error.
Reproduce code:
---------------
For your reference, i am using following code:
$dateDiff = mktime( $from['hour'] , $from['minutes'] , $from['seconds'] ,
$from['month'] , $from['day'] , $from['year']
) -
mktime( $to['hour'] , $to['minutes'] , $to['seconds']
,
$to['month'] , $to['day'] , $to['year']
);
$intDays = floor( $dateDiff / (60*60*24) );
$intHours = floor( ($dateDiff - ($intDays*60*60*24) ) / (60*60) );
$intMinutes = floor( ($dateDiff - ($intDays*60*60*24) -
($intHours*60*60) ) /60 );
--
Edit bug report at http://bugs.php.net/?id=46009&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=46009&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=46009&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=46009&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=46009&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=46009&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=46009&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=46009&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=46009&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=46009&r=support
Expected behavior: http://bugs.php.net/fix.php?id=46009&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=46009&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=46009&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=46009&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46009&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46009&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=46009&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=46009&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=46009&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=46009&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=46009&r=mysqlcfg