|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-06-15 10:53 UTC] derick@php.net
-Package: Date/time related
+Package: Documentation problem
[2016-06-15 10:53 UTC] derick@php.net
[2016-06-15 10:53 UTC] derick@php.net
-Status: Open
+Status: Feedback
[2016-06-26 04:22 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 01:00:01 2025 UTC |
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