note 24819 deleted from function.strtotime by vincent
| From: | vincent@php.net | Date: | Thu, 11 Sep 2003 19:43:48 +0000 |
| Subject: | note 24819 deleted from function.strtotime by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-56179@lists.php.net to get a copy of this message | ||
Note Submitter: jc@myrealbox.com
----
The code snippet given for validating date input does not work in all cases! Beware ...
strtotime will not check to see if the date passed in is valid before trying to return a timestamp.
This means that some inputs, like "1970-1-222" will return valid timestamps even though
they are invalid dates.
Use checkdate() to validate a date before passing it to the strtotime().