#34760 [NEW]: mktime() returns wrong timestamp for some spezific date

From: Date: Thu, 06 Oct 2005 12:58:29 +0000
Subject: #34760 [NEW]: mktime() returns wrong timestamp for some spezific date
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-86110@lists.php.net to get a copy of this message
From: csg at diatom dot de Operating system: Linux (SuSE 9.2 / 7.3) PHP version: 4.4.0 PHP Bug Type: Date/time related Bug description: mktime() returns wrong timestamp for some spezific date Description: ------------ For some dates, especially "Oct-08-2005", mktimes does return a wrong timestamp as result (here: "Sep-30-2005"). You can call the example script at URL: http://www.kunden-diatom.de/phpBug_mktime.php Reproduce code: --------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Bug in mktime()?</title> </head> <body> <h1>Ist das ein Bug in mktime() ?!</h1> <?php echo "<p>Noch richtig: date(\"M-d-Y\", mktime(15,0,0,10,07,2005)): " . date("M-d-Y", mktime(15,0,0,10,07,2005)) . " (Unix-Timestamp: " . mktime(15,0,0,10,07,2005) . ")</p>\n"; echo "<p>Leider falsch: date(\"M-d-Y\", mktime(15,0,0,10,08,2005)): " . date("M-d-Y", mktime(15,0,0,10,08,2005)) . " (Unix-Timestamp: " . mktime(15,0,0,10,08,2005) . ")</p>\n"; ?> </body> </html> Expected result: ---------------- Ist das ein Bug in mktime() ?! Noch richtig: date("M-d-Y", mktime(15,0,0,10,07,2005)): Oct-07-2005 (Unix-Timestamp: 1128690000) Leider falsch: date("M-d-Y", mktime(15,0,0,10,08,2005)): Oct-08-2005 (Unix-Timestamp: <some value bigger than 1128690000>) Actual result: -------------- Ist das ein Bug in mktime() ?! Noch richtig: date("M-d-Y", mktime(15,0,0,10,07,2005)): Oct-07-2005 (Unix-Timestamp: 1128690000) Leider falsch: date("M-d-Y", mktime(15,0,0,10,08,2005)): Sep-30-2005 (Unix-Timestamp: 1128085200) -- Edit bug report at http://bugs.php.net/?id=34760&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34760&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34760&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34760&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34760&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34760&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34760&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34760&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34760&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34760&r=support Expected behavior: http://bugs.php.net/fix.php?id=34760&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34760&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34760&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34760&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34760&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34760&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34760&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34760&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34760&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34760&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34760&r=mysqlcfg

« previous php.bugs (#86110) next »