note 24819 added to function.strtotime

From: Date: Thu, 29 Aug 2002 08:05:24 +0000
Subject: note 24819 added to function.strtotime
Groups: php.notes 
Request: Send a blank email to php-notes+get-35969@lists.php.net to get a copy of this message
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(). -- http://www.php.net/manual/en/function.strtotime.php http://master.php.net/manage/user-notes.php?action=edit+24819 http://master.php.net/manage/user-notes.php?action=delete+24819 http://master.php.net/manage/user-notes.php?action=reject+24819

« previous php.notes (#35969) next »