diff --git a/src/Carbon/Carbon.php b/src/Carbon/Carbon.php index efbdc23070..41ffcf6668 100644 --- a/src/Carbon/Carbon.php +++ b/src/Carbon/Carbon.php @@ -396,8 +396,11 @@ public function __construct($time = null, $tz = null) ) ) { $dateTime = new DateTime('now', $timezone); - $microTime = str_pad(strval(microtime(true) * 1000000 % 1000000), 6, '0', STR_PAD_LEFT); - $time = $dateTime->format(static::DEFAULT_TO_STRING_FORMAT).'.'.$microTime; + $microTime = microtime(true) * 1000000 % 1000000; + if ($microTime > 0) { + $microTime = str_pad(strval($microTime), 6, '0', STR_PAD_LEFT); + $time = $dateTime->format(static::DEFAULT_TO_STRING_FORMAT).'.'.$microTime; + } } // @codeCoverageIgnoreEnd