From: biv777 at front dot ru
Operating system: FreeBSD 4.8
PHP version: 4.3.7
PHP Bug Type: Date/time related
Bug description: mktime returns incorrect timestamp
Description:
------------
Reproduce code:
---------------
<?
$f_tm=1080075600; //3-24-2004
for($i=0; $i<7; $i++)
{
$arr_tm[]=$f_tm;
$f_tm=mktime(0, 0, 0, date("n",$f_tm), (date("j",$f_tm)+1),
date("Y",$f_tm));
}
foreach($arr_tm as $tm)
{
echo $tm." ".date("Y",$tm)."-".date("m",$tm)."-".date("d",$tm)."<br>";
}
?>
Expected result:
----------------
HTTP/1.1 200 OK
Date: Tue, 24 Aug 2004 19:44:04 GMT
Server: Apache/1.3.31 (Unix) mod_accounting/0.5l mod_ssl/2.8.18
OpenSSL/0.9.7d mod_deflate/1.0.21
X-Powered-By: PHP/4.3.5
Connection: close
Content-Type: text/html; charset=windows-1251
1048453200 2003-03-24
1048539600 2003-03-25
1048626000 2003-03-26
1048712400 2003-03-27
1048798800 2003-03-28
1048885200 2003-03-29
-7262 1970-01-01
Actual result:
--------------
--
Edit bug report at http://bugs.php.net/?id=29825&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29825&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=29825&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=29825&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=29825&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=29825&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29825&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=29825&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=29825&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=29825&r=support
Expected behavior: http://bugs.php.net/fix.php?id=29825&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=29825&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=29825&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=29825&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29825&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=29825&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=29825&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=29825&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29825&r=float