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

 ID:               51107
 Updated by:       [email protected]
 Reported by:      mail at henkbulder dot nl
 Summary:          date_parse_from_format does not parse after 'O' or 'Z'
                   - format
-Status:           No Feedback
+Status:           Closed
 Type:             Bug
 Package:          Date/time related
 Operating System: *
 PHP Version:      5.3.1
-Assigned To:      
+Assigned To:      felipe

 New Comment:

I can't reproduce it, it looks already fixed.


Previous Comments:
------------------------------------------------------------------------
[2010-03-01 01:00:01] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

------------------------------------------------------------------------
[2010-02-21 20:57:58] [email protected]

Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/



------------------------------------------------------------------------
[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/bug.php?id=51107&edit=1

Reply via email to