From: stas Operating system: * PHP version: 5.4.19 Package: Date/time related Bug Type: Bug Bug description:createFromFormat broken when weekday name is followed by some delimiters
Description: ------------ createFromFormat fails when in the format D or l is followed by separators that are not space or comma. Test script: --------------- $string = "Thu., Nov. 29, 2012 5:00PM"; $data = DateTime::createFromFormat( "D., M# j, Y g:iA", $string ); var_dump( $data ); var_dump( DateTime::getLastErrors() ); Expected result: ---------------- object(DateTime)#1 (3) { ["date"]=> string(19) "2012-11-29 17:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(19) "America/Los_Angeles" } array(4) { ["warning_count"]=> int(0) ["warnings"]=> array(0) { } ["error_count"]=> int(0) ["errors"]=> array(0) { } } Actual result: -------------- bool(false) array(4) { ["warning_count"]=> int(0) ["warnings"]=> array(0) { } ["error_count"]=> int(2) ["errors"]=> array(2) { [0]=> string(32) "A textual day could not be found" [4]=> string(40) "The separation symbol could not be found" } } -- Edit bug report at https://bugs.php.net/bug.php?id=65554&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=65554&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=65554&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=65554&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=65554&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=65554&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=65554&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=65554&r=needscript Try newer version: https://bugs.php.net/fix.php?id=65554&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=65554&r=support Expected behavior: https://bugs.php.net/fix.php?id=65554&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=65554&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=65554&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=65554&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65554&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=65554&r=dst IIS Stability: https://bugs.php.net/fix.php?id=65554&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=65554&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=65554&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=65554&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=65554&r=mysqlcfg