From: femi at vsinstitute dot com Operating system: ubuntu3.5 PHP version: 5.3Git-2013-07-03 (Git) Package: Class/Object related Bug Type: Feature/Change Request Bug description:Result from DateInterval->Format Should be Equivalent to Total Diff Value
Description: ------------ --- >From manual page: http://www.php.net/dateinterval.format#refsect1- dateinterval.format-description --- Code: echo date_diff(date_create('1970-00-00 00:00:00'), date_create())->format('%s'); Expected Output: - A big number (at least 1372823738) Current Output: - A number less than 60 The value of the output should add up to the smaller date in date diff to produce the larger date. Or at least approximately. Since I am only including s in the format, the reported value for s should be exactly equal to the Unix timestamp. Test script: --------------- echo date_diff(date_create('1970-00-00 00:00:00'), date_create())->format('%s'); Expected result: ---------------- A big number (at least 1372823738) Actual result: -------------- A number less than 60 -- Edit bug report at https://bugs.php.net/bug.php?id=65189&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=65189&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=65189&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=65189&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=65189&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=65189&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=65189&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=65189&r=needscript Try newer version: https://bugs.php.net/fix.php?id=65189&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=65189&r=support Expected behavior: https://bugs.php.net/fix.php?id=65189&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=65189&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=65189&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=65189&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65189&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=65189&r=dst IIS Stability: https://bugs.php.net/fix.php?id=65189&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=65189&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=65189&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=65189&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=65189&r=mysqlcfg