note 112872 added to class.dateinterval

From: Date: Wed, 31 Jul 2013 14:32:49 +0000
Subject: note 112872 added to class.dateinterval
Groups: php.notes 
Request: Send a blank email to php-notes+get-195837@lists.php.net to get a copy of this message
It appears that they "days" property that is populated by \DateTime::diff does not contain a float for the differences in time. It is rounded down to the nearest whole day. $d1 = new \DateTime("2013-07-31 10:29:00"); $d2 = new \DateTime("2013-08-02 5:32:12"); echo $d1->diff($d2)->days; Output: 1 ---- Server IP: 69.147.83.199 Probable Submitter: 162.17.136.165 ---- Manual Page -- http://php.net/manual/en/class.dateinterval.php Edit -- https://master.php.net/note/edit/112872 Del: integrated -- https://master.php.net/note/delete/112872/integrated Del: useless -- https://master.php.net/note/delete/112872/useless Del: bad code -- https://master.php.net/note/delete/112872/bad+code Del: spam -- https://master.php.net/note/delete/112872/spam Del: non-english -- https://master.php.net/note/delete/112872/non-english Del: in docs -- https://master.php.net/note/delete/112872/in+docs Del: other reasons-- https://master.php.net/note/delete/112872 Reject -- https://master.php.net/note/reject/112872 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#195837) next »