#36899 [Opn->Bgs]: strtotime fails to return null or false
| From: | iliaa@php.net | Date: | Wed, 29 Mar 2006 16:44:58 +0000 |
| Subject: | #36899 [Opn->Bgs]: strtotime fails to return null or false | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-95090@lists.php.net to get a copy of this message | ||
ID: 36899
Updated by: iliaa@php.net
Reported By: alan dot whitney at sephone dot com
-Status: Open
+Status: Bogus
Bug Type: Date/time related
Operating System: Linux (Fedora Core 2)
PHP Version: 5.1.2
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
This is how it should work.
Previous Comments:
------------------------------------------------------------------------
[2006-03-29 00:05:29] alan dot whitney at sephone dot com
I Downloaded and installed the latest snap shot. It didn't seem to fix
the problem. When I run this code:
$mktime = 1143592000;
$return = strtotime($mktime);
echo $return;
I get the output of 954261839. Which is a timestamp for 3/28/2000 at
11:43:59
I was expecting it to return false or null.
------------------------------------------------------------------------
[2006-03-28 23:41:49] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.1-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.1-win32-latest.zip
Can't reproduce.
------------------------------------------------------------------------
[2006-03-28 23:33:15] alan dot whitney at sephone dot com
Description:
------------
When you use strtotime on 1143522000 it returns a timestamp 6 years
eariler.
It seems to be if the string falls on the format HHMMSSYYYY and HH is
above 10 and SS is above 37 it will parse it out to be the time in the
string(HHMMSS), today's date and the year (YYYY) in the string.
Reproduce code:
---------------
$mktime = mktime(0,0,0, 3, 28, 2006);
$return = strtotime($mktime);
if ($return === false) {
echo "Nothing";
} else {
echo date("r", $return);
}
Expected result:
----------------
Nothing
Actual result:
--------------
Tue, 28 Mar 2000 11:43:52 -0500
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36899&edit=1