#51030 [NEW]: DateInterval::format() does not handle "carry-over points"
| From: | m dot kurzyna at crystalpoint dot pl | Date: | Fri, 12 Feb 2010 20:02:07 +0000 |
| Subject: | #51030 [NEW]: DateInterval::format() does not handle "carry-over points" | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-3879@lists.php.net to get a copy of this message | ||
From: m dot kurzyna at crystalpoint dot pl
Operating system: Linux
PHP version: Irrelevant
PHP Bug Type: Documentation problem
Bug description: DateInterval::format() does not handle "carry-over points"
Description:
------------
DateInterval::format() does not handle "carry over points" thus having 25
hours or 70 minutes is a valid output. Format description suggests that
output would be recalculated (but specifying min,middle,max sample
outputs).
Submitted as documentation problem but IMHO the implementation could be
changed (at least be optional whether to recalculate carry overs or not).
Reproduce code:
---------------
<?php
$dti = new \DateInterval('PT70M');
echo $dti->format('%H:%I:%S');
?>
Expected result:
----------------
01:10:00
Actual result:
--------------
00:70:00
--
Edit bug report at http://bugs.php.net/?id=51030&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51030&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51030&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51030&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=51030&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51030&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=51030&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=51030&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=51030&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=51030&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=51030&r=support
Expected behavior: http://bugs.php.net/fix.php?id=51030&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=51030&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=51030&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=51030&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51030&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=51030&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=51030&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=51030&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=51030&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=51030&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=51030&r=mysqlcfg