Bug #72410 [NEW]: DateTime::format() displays char "T" when use DateTime::ATOM for parameter
| From: | nask0 at cod3r dot net | Date: | Wed, 15 Jun 2016 09:59:33 +0000 |
| Subject: | Bug #72410 [NEW]: DateTime::format() displays char "T" when use DateTime::ATOM for parameter | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-201639@lists.php.net to get a copy of this message | ||
From: nask0 at cod3r dot net
Operating system: Fedora
PHP version: 5.6.22
Package: Date/time related
Bug Type: Bug
Bug description:DateTime::format() displays char "T" when use DateTime::ATOM for parameter
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 bug report at https://bugs.php.net/bug.php?id=72410&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72410&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72410&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72410&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=72410&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=72410&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=72410&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=72410&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=72410&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=72410&r=support
Expected behavior: https://bugs.php.net/fix.php?id=72410&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=72410&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=72410&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=72410&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72410&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=72410&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=72410&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=72410&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72410&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=72410&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=72410&r=mysqlcfg