#34760 [Opn->Bgs]: mktime() returns wrong timestamp for some spezific date
| From: | derick@php.net | Date: | Thu, 06 Oct 2005 13:04:57 +0000 |
| Subject: | #34760 [Opn->Bgs]: mktime() returns wrong timestamp for some spezific date | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-86111@lists.php.net to get a copy of this message | ||
ID: 34760
Updated by: derick@php.net
Reported By: csg at diatom dot de
-Status: Open
+Status: Bogus
Bug Type: Date/time related
Operating System: Linux (SuSE 9.2 / 7.3)
PHP Version: 4.4.0
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
No bug here, you're using octal numbers (07 -> 7 but 08 doesn't exist).
Previous Comments:
------------------------------------------------------------------------
[2005-10-06 14:58:28] 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)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34760&edit=1