#51030 [Opn]: DateInterval::format() does not handle "carry-over points"
| From: | derick@php.net | Date: | Fri, 12 Feb 2010 20:39:37 +0000 |
| Subject: | #51030 [Opn]: DateInterval::format() does not handle "carry-over points" | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-3880@lists.php.net to get a copy of this message | ||
ID: 51030
Updated by: derick@php.net
Reported By: m dot kurzyna at crystalpoint dot pl
Status: Open
Bug Type: Documentation problem
Operating System: Linux
PHP Version: Irrelevant
New Comment:
THis is (code wise) on purpose, because you can't really overflow "32
days" for example (it could be 1month, 4 days to 1 month, 1 days f.e.)
Previous Comments:
------------------------------------------------------------------------
[2010-02-12 20:02:07] m dot kurzyna at crystalpoint dot pl
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 this bug report at http://bugs.php.net/?id=51030&edit=1