#36899 [Fbk->Opn]: strtotime fails to return null or false
| From: | alan dot whitney at sephone dot com | Date: | Tue, 28 Mar 2006 22:05:31 +0000 |
| Subject: | #36899 [Fbk->Opn]: strtotime fails to return null or false | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-95037@lists.php.net to get a copy of this message | ||
ID: 36899
User updated by: alan dot whitney at sephone dot com
Reported By: alan dot whitney at sephone dot com
-Status: Feedback
+Status: Open
Bug Type: Date/time related
Operating System: Linux (Fedora Core 2)
PHP Version: 5.1.2
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[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