ID:               19165
 Updated by:       [EMAIL PROTECTED]
 Reported By:      jc at mega-bucks dot co dot jp
-Status:           Duplicate
+Status:           Closed
 Bug Type:         Date/time related
 Operating System: Red Hat Linux 7.2
 PHP Version:      4.2.2
 New Comment:

Fixed in PHP 5, wont fix in PHP 4.



Previous Comments:
------------------------------------------------------------------------

[2002-08-29 08:35:08] [EMAIL PROTECTED]

Marking this as dup of 18101 instead, this beast needs rewriting :)

Derick

------------------------------------------------------------------------

[2002-08-29 03:51:44] jc at mega-bucks dot co dot jp

Ok. Does this mean that strtotime() is *not* meant to pick up invalid
date inputs and fail on them?

------------------------------------------------------------------------

[2002-08-29 03:47:35] [EMAIL PROTECTED]

I'm marking this as duplicate of 19166, because IMO this is a
documentation problem rather than a problem in the code.

Derick

------------------------------------------------------------------------

[2002-08-29 03:43:03] jc at mega-bucks dot co dot jp

This code shows that strtotime does not recognize some dates that are
in the correct format but invalid:

$bod = "1970-1-222";
echo "I think that $bod is timestamp " . strtotime($bod) . "<BR>";
echo "and that would be " . date("Y-n-d",strtotime($bod)). "<BR>";

The output is:

I think that 1970-1-222 is timestamp 19062000
and that would be 1970-8-10

The documentation says that strtotime should report -1 on a failure.
Shouldn't this be a failure?

Jc

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=19165&edit=1

Reply via email to