|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-12-08 10:44 UTC] yoarvi at gmail dot com
[2009-12-08 10:58 UTC] derick@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 07 14:00:01 2025 UTC |
Description: ------------ DateInterval::format method just returns the parameter given. Reproduce code: --------------- <?php $date1 = new DateTime('2009-06-19 20:00:00'); $date2 = new DateTime('2009-06-19 20:00:40'); $diff = $date1->diff($date2,TRUE); print_r($diff); var_dump($diff->format('H:i:s')); var_dump($diff->format('Y-m-d H:i:s')); ?> Expected result: ---------------- DateInterval Object ( [y] => 0 [m] => 0 [d] => 0 [h] => 0 [i] => 0 [s] => 40 [invert] => 0 [days] => 0 ) string(5) "00:00:40" string(11) "0000-00-00 00:00:40" Actual result: -------------- DateInterval Object ( [y] => 0 [m] => 0 [d] => 0 [h] => 0 [i] => 0 [s] => 40 [invert] => 0 [days] => 0 ) string(5) "H:i:s" string(11) "Y-m-d H:i:s"