|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72410 DateTime::format() displays char "T" when use DateTime::ATOM for parameter
Submitted: 2016-06-15 09:59 UTC Modified: 2016-06-26 04:22 UTC
From: nask0 at cod3r dot net Assigned:
Status: No Feedback Package: Documentation problem
PHP Version: 5.6.22 OS: Fedora
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: nask0 at cod3r dot net
New email:
PHP Version: OS:


 [2016-06-15 09:59 UTC] nask0 at cod3r dot net
When use \DateTime::format() with \DateTime::ATOM parameter, it displays char "T" instead of timezone abbreviation as described in manual.
Consider test script, it is pretty self-explanatory.	

Test script:
$date = new \DateTime( 'now', new \DateTimeZone('UTC') );

echo "\DateTime::ATOM format : " . $date->format( \DateTime::ATOM )."\n";
echo "'Y-m-d\TH:i:sP' format : " . $date->format( 'Y-m-d\TH:i:sP')."\n";
echo "Y-m-d T H:i:sP format : " . $date->format( "Y-m-d T H:i:sP")."\n";

Expected result:
\DateTime::ATOM format : 2016-06-15\UTC09:57:38+00:00
'Y-m-d\TH:i:sP' format : 2016-06-15\UTC09:57:38+00:00
Y-m-d T H:i:sP format : 2016-06-15 UTC 09:57:38+00:00

Actual result:
\DateTime::ATOM format : 2016-06-15T09:57:38+00:00
'Y-m-d\TH:i:sP' format : 2016-06-15T09:57:38+00:00
Y-m-d T H:i:sP format : 2016-06-15 UTC 09:57:38+00:00


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-06-15 10:53 UTC]
-Package: Date/time related +Package: Documentation problem
 [2016-06-15 10:53 UTC]
The actual result is correct, it should show the literal "T". Where in the documentation does it say it should be the timezone abbreviation?
 [2016-06-15 10:53 UTC]
-Status: Open +Status: Feedback
 [2016-06-26 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Jul 01 21:05:44 2022 UTC