Bug #72410 [Opn->Fbk]: DateTime::format() displays char "T" when use DateTime::ATOM for parameter

From: Date: Wed, 15 Jun 2016 10:53:23 +0000
Subject: Bug #72410 [Opn->Fbk]: DateTime::format() displays char "T" when use DateTime::ATOM for parameter
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-13530@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72410&edit=1 ID: 72410 Updated by: derick@php.net Reported by: nask0 at cod3r dot net Summary: DateTime::format() displays char "T" when use DateTime::ATOM for parameter -Status: Open +Status: Feedback Type: Bug Package: Documentation problem Operating System: Fedora PHP Version: 5.6.22 Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2016-06-15 10:53:13] derick@php.net 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 09:59:31] nask0 at cod3r dot net Description: ------------ 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: --------------- <?php $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 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=72410&edit=1

« previous php.doc.bugs (#13530) next »