#51107 [Opn->Fbk]: date_parse_from_format does not parse after 'O' or 'Z' - format
| From: | jani@php.net | Date: | Sun, 21 Feb 2010 20:57:59 +0000 |
| Subject: | #51107 [Opn->Fbk]: date_parse_from_format does not parse after 'O' or 'Z' - format | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-147930@lists.php.net to get a copy of this message | ||
ID: 51107
Updated by: jani@php.net
Reported By: mail at henkbulder dot nl
-Status: Open
+Status: Feedback
Bug Type: Date/time related
-Operating System:
+Operating System: *
PHP Version: 5.3.1
New Comment:
Please try using this snapshot:
http://snaps.php.net/php5.3-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
Previous Comments:
------------------------------------------------------------------------
[2010-02-21 19:51:47] mail at henkbulder dot nl
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 this bug report at http://bugs.php.net/?id=51107&edit=1