|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-02-21 20:57 UTC] jani@php.net
[2010-03-01 01:00 UTC] php-bugs at lists dot php dot net
[2010-04-25 19:57 UTC] felipe@php.net
-Status: No Feedback
+Status: Closed
-Assigned To:
+Assigned To: felipe
[2010-04-25 19:57 UTC] felipe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 17:00:02 2025 UTC |
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] => )