Bug #77007 [Opn->Csd]: fractions in `diff()` are not correctly normalized

From: Date: Fri, 12 Oct 2018 10:41:44 +0000
Subject: Bug #77007 [Opn->Csd]: fractions in `diff()` are not correctly normalized
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217536@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77007&edit=1 ID: 77007 Updated by: derick@php.net Reported by: derick@php.net Summary: fractions in diff() are not correctly normalized -Status: Open +Status: Closed Type: Bug Package: Date/time related PHP Version: 7.2.11 Block user comment: N Private report: N New Comment: Automatic comment on behalf of github@derickrethans.nl Revision: http://git.php.net/?p=php-src.git;a=commit;h=94a98f2c63926c5eafe12a717f3eef38f05fe99e Log: Upgrade timelib to 2017.08, to fix bug #77007 Previous Comments: ------------------------------------------------------------------------ [2018-10-12 10:39:08] derick@php.net Description: ------------ See https://github.com/derickr/timelib/issues/50 Test script: --------------- <?php $startDate = new \DateTime('2018-10-11 20:59:06.914653'); $endDate = new \DateTime('2018-10-11 20:59:07.237419'); $interval = $startDate->diff($endDate); var_dump($interval->format('%H:%I:%S.%F')); Expected result: ---------------- string(16) "00:00:00.322766" Actual result: -------------- string(16) "00:00:01.-677234" ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77007&edit=1

« previous php.bugs (#217536) next »