Edit report at https://bugs.php.net/bug.php?id=62179&edit=1

 ID:                 62179
 Comment by:         aldekein at myevil dot info
 Reported by:        aldekein at myevil dot info
 Summary:            strtotime returns current date instead of false or
                     correct timestamp
 Status:             Open
 Type:               Bug
 Package:            *General Issues
 Operating System:   linux / windows
 PHP Version:        5.3.13
 Block user comment: N
 Private report:     N

 New Comment:

I believe that there's a problem in format parser that cause disambiguation:

strtotime('24.11.07') is parsed as valid time.
strtotime('25.11.07') is parsed as valid date.

http://us2.php.net/manual/en/datetime.formats.date.php declares dd [.\t] mm "." 
yy
http://us2.php.net/manual/en/datetime.formats.time.php declares 't'? HH [.:] MM 
[.:] II


Previous Comments:
------------------------------------------------------------------------
[2012-05-29 10:12:03] aldekein at myevil dot info

It tries to parse value as time.

And strtotime('11.05.07 00:00:00') === false

------------------------------------------------------------------------
[2012-05-29 09:57:04] aldekein at myevil dot info

Description:
------------
So why do strtotime return current date instead of correct date or FALSE?

Test script:
---------------
$datetime = strtotime('11.05.07');
if ($datetime === false) die('fail');
echo date('d.m.Y', $datetime);

Expected result:
----------------
11.05.2007

Actual result:
--------------
29.05.2012 (current date)


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



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

Reply via email to