src/DateTime.php
protected function subMicroseconds($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 < 0) {
            $diff = abs($diff);
            $seconds++;
        }

        $this->modify("$seconds seconds");
        $this->setMicroseconds($diff);
    }
protected function subMicroseconds($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 < 0) {
            $diff = abs($diff);
            $seconds++;
        }

        $this->modify("$seconds seconds");
        $this->setMicroseconds($diff);
    }
protected function subMicroseconds ( $ 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 < 0 ) { $ diff = abs ( $ diff ) ; $ seconds ++ ; } $ this -> modify ( "$seconds seconds" ) ; $ this -> setMicroseconds ( $ diff ) ; }
Adds an amount of microseconds to a DateTime object

@param $microseconds
Adds an amount of microseconds to a DateTime object