Skip to content

Commit

Permalink
Fixed condition for check is negative interval or not
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Klimchuk committed Aug 26, 2015
1 parent ce7fc9f commit fc48c95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DateTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fc48c95

Please sign in to comment.