note 77871 modified in function.date-create by derick

From: Date: Thu, 17 Jan 2008 09:11:38 +0000
Subject: note 77871 modified in function.date-create by derick
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-135159@lists.php.net to get a copy of this message
The manual says "Returns DateTime object on success or FALSE on failure". I tried hard to provoke a failure, but I seem to always get a DateTime object back, even though the PHP log says things like: "Failed to parse time string (2007W992-11:16:47+00:00) at position 5 (9): Unexpected character" So if you (need to) check the result, beware! [red. in PHP 5.3 and higher, you can do that with DateTime::getLastErrors().] --was-- The manual says "Returns DateTime object on success or FALSE on failure". I tried hard to provoke a failure, but I seem to always get a DateTime object back, even though the PHP log says things like: "Failed to parse time string (2007W992-11:16:47+00:00) at position 5 (9): Unexpected character" So if you (need to) check the result, beware! http://php.net/manual/en/function.date-create.php

« previous php.notes (#135159) next »