Doc #62626 [NEW]: not showing proper value

From: Date: Sat, 21 Jul 2012 04:39:47 +0000
Subject: Doc #62626 [NEW]: not showing proper value
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-8622@lists.php.net to get a copy of this message
From:             abhilashdas at gmail dot com
Operating system: win 7
PHP version:      5.4.5
Package:          Date/time related
Bug Type:         Documentation Problem
Bug description:not showing proper value

Description:
------------
---
From manual page: http://www.php.net/datetime.diff#refsect1-datetime.diff-
returnvalues
---

$datetime1 = date_create('2009-10-11');
$datetime2 = date_create('2009-10-13');
$interval = date_diff($datetime1, $datetime2);
echo $interval->format('%R%a days');

This is suppose to give me +2 as out put. But I am getting +6015 day.

Not sure it is a bug or some setting problem.
My machine is win7 and timezone is +5:30


Test script:
---------------
$datetime1 = date_create('2009-10-11');
$datetime2 = date_create('2009-10-13');
$interval = date_diff($datetime1, $datetime2);
echo $interval->format('%R%a days');

Expected result:
----------------
+2 days

Actual result:
--------------
+6015 days

-- 
Edit bug report at https://bugs.php.net/bug.php?id=62626&edit=1
-- 
Try a snapshot (PHP 5.4):            https://bugs.php.net/fix.php?id=62626&r=trysnapshot54
Try a snapshot (PHP 5.3):            https://bugs.php.net/fix.php?id=62626&r=trysnapshot53
Try a snapshot (trunk):              https://bugs.php.net/fix.php?id=62626&r=trysnapshottrunk
Fixed in SVN:                        https://bugs.php.net/fix.php?id=62626&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=62626&r=needdocs
Fixed in release:                    https://bugs.php.net/fix.php?id=62626&r=alreadyfixed
Need backtrace:                      https://bugs.php.net/fix.php?id=62626&r=needtrace
Need Reproduce Script:               https://bugs.php.net/fix.php?id=62626&r=needscript
Try newer version:                   https://bugs.php.net/fix.php?id=62626&r=oldversion
Not developer issue:                 https://bugs.php.net/fix.php?id=62626&r=support
Expected behavior:                   https://bugs.php.net/fix.php?id=62626&r=notwrong
Not enough info:                     https://bugs.php.net/fix.php?id=62626&r=notenoughinfo
Submitted twice:                     https://bugs.php.net/fix.php?id=62626&r=submittedtwice
register_globals:                    https://bugs.php.net/fix.php?id=62626&r=globals
PHP 4 support discontinued:          https://bugs.php.net/fix.php?id=62626&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=62626&r=dst
IIS Stability:                       https://bugs.php.net/fix.php?id=62626&r=isapi
Install GNU Sed:                     https://bugs.php.net/fix.php?id=62626&r=gnused
Floating point limitations:          https://bugs.php.net/fix.php?id=62626&r=float
No Zend Extensions:                  https://bugs.php.net/fix.php?id=62626&r=nozend
MySQL Configuration Error:           https://bugs.php.net/fix.php?id=62626&r=mysqlcfg



Thread (3 messages)

« previous php.doc.bugs (#8622) next »