php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50199 date_parse_from_format() fails to parse ISO 8601 date
Submitted: 2009-11-16 23:14 UTC Modified: 2009-11-21 22:57 UTC
From: peter dot ritt at gmx dot net Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.3, 6 OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: peter dot ritt at gmx dot net
New email:
PHP Version: OS:

 

 [2009-11-16 23:14 UTC] peter dot ritt at gmx dot net
Description:
------------
date_parse_from_format refuses to read '2009-11-17T00:08:24+01:00';
error: The format separator does not match

Reproduce code:
---------------
$d = date('c');
echo $d;
echo "\n";
print_r(date_parse_from_format('c', $d));


Expected result:
----------------
array with data as specified in function.date-parse-from-format.php

Actual result:
--------------
Array
(
    [year] =>
    [month] =>
    [day] =>
    [hour] =>
    [minute] =>
    [second] =>
    [fraction] =>
    [warning_count] => 0
    [warnings] => Array
        (
        )

    [error_count] => 2
    [errors] => Array
        (
            [0] => The format separator does not match
            [1] => Trailing data
        )

    [is_localtime] =>
)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-11-19 13:28 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

The "c" format is not supported by the date_parse_from_format() 
function.
 [2009-11-21 22:30 UTC] peter dot ritt at gmx dot net
double checked docs, only found:
"Format accepted by date() with some extras."
no info concerning those extras;
would you mind providing more details in the docs?
thanks
 [2009-11-21 22:57 UTC] derick@php.net
Yes, that's tracked in http://bugs.php.net/bug.php?id=36474
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 09 23:01:33 2025 UTC