|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-10-06 14:58 UTC] csg at diatom dot de
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) PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 07:00:01 2026 UTC |
Also, file your bugs in english only without all the extra HTML the next time please, just: echo date("M-d-Y", mktime(15,0,0,10,08,2005)); would have done it.