Bug #74517 [Opn->Nab]: Incorrect date string to int conversion

From: Date: Mon, 01 May 2017 07:14:57 +0000
Subject: Bug #74517 [Opn->Nab]: Incorrect date string to int conversion
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-208881@lists.php.net to get a copy of this message
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)

« previous php.bugs (#208881) next »