From: ploeger dot private at googlemail dot com
Operating system: Windows Server 2008 R2
PHP version: 5.3Git-2012-06-14 (snap)
Package: Class/Object related
Bug Type: Bug
Bug description:date_diff() function returns false result
Description:
------------
The source code will return 05 instead of 06.
If you change the day to 02 instead of 01 in start_timestamp and
end_timestamp
everything seems to work correct.
Debug:
print_r($start_timestamp);
Result: DateTime Object ( [date] => 2012-06-01 00:00:00 [timezone_type] =>
3
[timezone] => Europe/Berlin )
print_r($end_timestamp);
Result: DateTime Object ( [date] => 2012-12-01 00:00:00 [timezone_type] =>
3
[timezone] => Europe/Berlin )
Test script:
---------------
$start_timestamp = date_create('2012-06-01');
$end_timestamp = date_create('2012-12-01');
$difference = date_diff($start_timestamp, $end_timestamp);
$difference = $difference->format('%M');
Expected result:
----------------
06
Actual result:
--------------
05
--
Edit bug report at https://bugs.php.net/bug.php?id=62326&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=62326&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=62326&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=62326&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=62326&r=fixed
Fixed in SVN and need be documented:
https://bugs.php.net/fix.php?id=62326&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=62326&r=alreadyfixed
Need backtrace:
https://bugs.php.net/fix.php?id=62326&r=needtrace
Need Reproduce Script:
https://bugs.php.net/fix.php?id=62326&r=needscript
Try newer version:
https://bugs.php.net/fix.php?id=62326&r=oldversion
Not developer issue:
https://bugs.php.net/fix.php?id=62326&r=support
Expected behavior:
https://bugs.php.net/fix.php?id=62326&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=62326&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=62326&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=62326&r=globals
PHP 4 support discontinued:
https://bugs.php.net/fix.php?id=62326&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=62326&r=dst
IIS Stability:
https://bugs.php.net/fix.php?id=62326&r=isapi
Install GNU Sed:
https://bugs.php.net/fix.php?id=62326&r=gnused
Floating point limitations:
https://bugs.php.net/fix.php?id=62326&r=float
No Zend Extensions:
https://bugs.php.net/fix.php?id=62326&r=nozend
MySQL Configuration Error:
https://bugs.php.net/fix.php?id=62326&r=mysqlcfg