Edit report at https://bugs.php.net/bug.php?id=65189&edit=1

 ID:                 65189
 Updated by:         ahar...@php.net
 Reported by:        femi at vsinstitute dot com
 Summary:            Result from DateInterval->Format Should be
                     Equivalent to Total Diff Value
-Status:             Open
+Status:             Duplicate
 Type:               Feature/Change Request
-Package:            Class/Object related
+Package:            Date/time related
 Operating System:   ubuntu3.5
 PHP Version:        5.3Git-2013-07-03 (Git)
 Block user comment: N
 Private report:     N

 New Comment:

Duplicate of request #50075.


Previous Comments:
------------------------------------------------------------------------
[2013-07-03 03:58:27] femi at vsinstitute dot com

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 this bug report at https://bugs.php.net/bug.php?id=65189&edit=1

Reply via email to