ID:               51107
 Updated by:       [email protected]
 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

Reply via email to