ID: 50392
Updated by: [email protected]
Reported By: grodny at oneclick dot sk
-Status: Open
+Status: Assigned
Bug Type: Date/time related
PHP Version: 5.3.1
-Assigned To:
+Assigned To: derick
New Comment:
Hi,
I guess it's not really required, I'll have a look (in a bit).
Derick
Previous Comments:
------------------------------------------------------------------------
[2009-12-06 10:53:34] grodny at oneclick dot sk
Description:
------------
As a result of fixing bug #45554, 'u' format character now requires
exactly 6 digits of microsecond part during parsing.
Patch fragment:
...
if ((f = timelib_get_nr((char **) &ptr, 6)) == TIMELIB_UNSET || ptr -
tptr != 6) {
...
Is check for exactly 6 digits really necessary, while other format
characters are more benevolent about number of digits being parsed?
Reproduce code:
---------------
date_default_timezone_set('Europe/Bratislava');
var_dump(date_create_from_format('Y-m-d H:i:s.u', '2009-03-01
18:00:00.0'));
Expected result:
----------------
object(DateTime)#1 (3) {
["date"]=>
string(19) "2009-03-01 18:00:00"
["timezone_type"]=>
int(3)
["timezone"]=>
string(17) "Europe/Bratislava"
}
Actual result:
--------------
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50392&edit=1