From fc48c95868feface8b769dd956509b54c5dd8ab5 Mon Sep 17 00:00:00 2001 From: Ivan Klimchuk Date: Wed, 26 Aug 2015 18:24:59 +0300 Subject: [PATCH] Fixed condition for check is negative interval or not --- src/DateTime.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DateTime.php b/src/DateTime.php index 363496b..dbdcc1c 100644 --- a/src/DateTime.php +++ b/src/DateTime.php @@ -233,7 +233,7 @@ public function diff($datetime, $absolute = false) } $interval->s = 0; - $negative = $d1->getTimestampWithMicroseconds() >= $d2->getTimestampWithMicroseconds(); + $negative = $d1->getTimestampWithMicroseconds() > $d2->getTimestampWithMicroseconds(); $diff = abs($d1->getTimestampWithMicroseconds() - $d2->getTimestampWithMicroseconds()); $seconds = intval($diff);