#51107 [NEW]: date_parse_from_format does not parse after 'O' or 'Z' - format

From: Date: Sun, 21 Feb 2010 19:51:47 +0000
Subject: #51107 [NEW]: date_parse_from_format does not parse after 'O' or 'Z' - format
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-147928@lists.php.net to get a copy of this message
From: mail at henkbulder dot nl Operating system: PHP version: 5.3.1 PHP Bug Type: Date/time related Bug description: date_parse_from_format does not parse after 'O' or 'Z' - format Description: ------------ date_parse_from_format doesn't seem to parse anything after (at the right hand of) a timezone-offset ('O' or 'Z'). I shuffled the date-string (and format-strings accordingly) around a few times, and the only way to properly fill the array seems to be putting timezone-offset at the end of the string. Reproduce code: --------------- $testdate = "Sat Feb 20 +0000 15:37:44 2010"; $createdarr = date_parse_from_format("D M d O G:i:s Y", $testdate); print_r($createdarr); Expected result: ---------------- Array ( [year] => 2010 [month] => 2 [day] => 20 [hour] => 15 [minute] => 37 [second] => 44 [fraction] => [warning_count] => 0 [warnings] => Array ( ) [error_count] => 0 [errors] => Array ( ) [is_localtime] => 1 [zone_type] => 1 [zone] => 0 [is_dst] => ) Actual result: -------------- Array ( [year] => [month] => 2 [day] => 20 [hour] => [minute] => [second] => [fraction] => [warning_count] => 0 [warnings] => Array ( ) [error_count] => 1 [errors] => Array ( [30] => Data missing ) [is_localtime] => 1 [zone_type] => 1 [zone] => 0 [is_dst] => ) -- Edit bug report at http://bugs.php.net/?id=51107&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51107&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51107&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51107&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=51107&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51107&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=51107&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=51107&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=51107&r=needscript Try newer version: http://bugs.php.net/fix.php?id=51107&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=51107&r=support Expected behavior: http://bugs.php.net/fix.php?id=51107&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=51107&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=51107&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=51107&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51107&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=51107&r=dst IIS Stability: http://bugs.php.net/fix.php?id=51107&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=51107&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=51107&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=51107&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=51107&r=mysqlcfg

« previous php.bugs (#147928) next »