Doc #62626 [Opn->Fbk]: not showing proper value

From: Date: Mon, 23 Jul 2012 13:27:52 +0000
Subject: Doc #62626 [Opn->Fbk]: not showing proper value
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-8627@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=62626&edit=1 ID: 62626 Updated by: fa@php.net Reported by: abhilashdas at gmail dot com Summary: not showing proper value -Status: Open +Status: Feedback Type: Documentation Problem Package: Date/time related Operating System: win 7 PHP Version: 5.4.5 Block user comment: N Private report: N New Comment: Works for me on 5.4.5/Debian. Have you set your timezone? e.g. with date_default_timezone_set("Europe/Berlin"); Previous Comments: ------------------------------------------------------------------------ [2012-07-21 04:39:47] abhilashdas at gmail dot com 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 this bug report at https://bugs.php.net/bug.php?id=62626&edit=1

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