Skip to content

Commit

Permalink
Use microseconds property to better value extraction instead of `to…
Browse files Browse the repository at this point in the history
…talMicroseconds`
  • Loading branch information
roxblnfk committed Apr 17, 2024
1 parent 7efb77c commit 6584c02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Internal/Support/DateInterval.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public static function toDuration(\DateInterval $i = null): ?Duration
$d = new Duration();
$parsed = self::parse($i);
$d->setSeconds((int)$parsed->totalSeconds);
$d->setNanos(($parsed->totalMicroseconds % 1_000_000) * 1000);
$d->setNanos(($parsed->microseconds % 1_000_000) * 1000);

return $d;
}
Expand Down

0 comments on commit 6584c02

Please sign in to comment.