Bug #74517 [Opn->Nab]: Incorrect date string to int conversion
Edit report at https://bugs.php.net/bug.php?id=74517&edit=1
ID: 74517
Updated by: requinix@php.net
Reported by: apollo880 at gmail dot com
Summary: Incorrect date string to int conversion
-Status: Open
+Status: Not a bug
Type: Bug
-Package: *General Issues
+Package: Date/time related
Operating System: All systems
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
strtotime will try to come up with the most reasonable date it can from the string passed. Dates
with invalid month or day numbers will underflow or overflow.
If you want validation then use DateTime and its getLastErrors().
Previous Comments:
------------------------------------------------------------------------
[2017-05-01 00:10:43] apollo880 at gmail dot com
Description:
------------
An incorrect date string to int conversion in strtotime() with use the YYYY-MM-DD format
Test script:
---------------
echo strtotime('1996-12-01') // return 849387600, it's OK
echo strtotime('1996-11-31') // return 849387600, it's FAIL, this date not exists,
need return false
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74517&edit=1
Thread (2 messages)