src/DateTime.php
protected function addMicroseconds($microseconds)
    {
        if ($microseconds < 0) {
            throw new \InvalidArgumentException("Value of microseconds should be positive.");
        }

        $diff = $this->getMicroseconds() + $microseconds;
        $seconds = floor($diff / 1e6);
        $diff -= $seconds * 1e6;

        if ($diff >= 1e6) {
            $diff -= 1e6;
            $seconds++;
        }

        $this->modify("+$seconds seconds");
        $this->setMicroseconds($diff);
    }
protected function addMicroseconds($microseconds)
    {
        if ($microseconds < 0) {
            throw new \InvalidArgumentException("Value of microseconds should be positive.");
        }

        $diff = $this->getMicroseconds() + $microseconds;
        $seconds = floor($diff / 1e6);
        $diff -= $seconds * 1e6;

        if ($diff >= 1e6) {
            $diff -= 1e6;
            $seconds++;
        }

        $this->modify("+$seconds seconds");
        $this->setMicroseconds($diff);
    }
protected function addMicroseconds ( $ microseconds ) { if ( $ microseconds < 0 ) { throw new \ InvalidArgumentException ( "Value of microseconds should be positive." ) ; } $ diff = $ this -> getMicroseconds ( ) + $ microseconds ; $ seconds = floor ( $ diff / 1e6 ) ; $ diff -= $ seconds * 1e6 ; if ( $ diff >= 1e6 ) { $ diff -= 1e6 ; $ seconds ++ ; } $ this -> modify ( "+$seconds seconds" ) ; $ this -> setMicroseconds ( $ diff ) ; }
Subtracts an amount of microseconds from a DateTime object

@param $microseconds
Subtracts an amount of microseconds from a DateTime object