Edit report at https://bugs.php.net/bug.php?id=65554&edit=1

 ID:                 65554
 Updated by:         s...@php.net
 Reported by:        s...@php.net
 Summary:            createFromFormat broken when weekday name is
                     followed by some delimiters
-Status:             Open
+Status:             Closed
 Type:               Bug
 Package:            Date/time related
 Operating System:   *
 PHP Version:        5.4.19
 Block user comment: N
 Private report:     N

 New Comment:

Automatic comment on behalf of vlogvins...@cogniance.com
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=e6424d89e9419e610ea95484081b9c26b0a7c044
Log: Fix bug #65554 in DateTime, when use it with D/l in format and textual day 
have dot at the end


Previous Comments:
------------------------------------------------------------------------
[2013-08-25 22:01:46] s...@php.net

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 this bug report at https://bugs.php.net/bug.php?id=65554&edit=1

Reply via email to