|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2013-08-25 22:15 UTC] stas@php.net
[2013-08-25 22:15 UTC] stas@php.net
-Status: Open
+Status: Closed
[2014-08-22 07:07 UTC] ab@php.net
[2014-10-07 23:17 UTC] stas@php.net
[2014-10-07 23:28 UTC] stas@php.net
[2016-07-20 11:41 UTC] davey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 14:00:01 2025 UTC |
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" } }