Adds an amount of microseconds to a DateTime object

@param $microseconds
168161
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);
    }
1198980
public function setSTSLifetime(int $seconds)
    {
        $seconds = $seconds;

        if ($seconds >= 900 && $seconds <= 3600) {
            $this->stsLifetime = $seconds;
        }
    }
514709
public function mesas_abiertas( $microtime = 0 ) {
            
            $lastAccess = null;
            $type = 'created';
            if ( $microtime != 0 ) {
            	$type = 'modified';
                $lastAccess = $this->Session->read('lastAccess');


                // setear el nuevo lastAccess
                $nowTime = date('Y-m-d H:i:s', strtotime('now'));
                $this->Session->write('lastAccess', $nowTime );

                // ver las borradas o con checkout
	            $borradas = $this->Mozo->mesasBorradas( null, $lastAccess);
	            if ( !empty($borradas) ) {
		            $mesas['borradas'] = $borradas;
	            }
            }

            $mesas[$type] = $this->Mozo->mesasAbiertas( null, $lastAccess);

            

            
            $this->set('mesasLastUpdatedTime', 1 );
            $this->set('modified', $lastAccess );
            $this->set('mesas', $mesas );
            
        }
736562
public function add_hours($hours)
    {
        $this->time += $hours * self::$TIME2SEC['h'];
        $this->set_timestamp($this->time);
        
        return $this;
    }
745883
def prepare_time_micros(data, schema):
    """"""
    if isinstance(data, datetime.time):
        return long(data.hour * MCS_PER_HOUR + data.minute * MCS_PER_MINUTE
                    + data.second * MCS_PER_SECOND + data.microsecond)
    else:
        return data
510087
public static function get_microtime() {
        list($tps_usec, $tps_sec) = explode(' ', microtime());
        return (float) $tps_usec + (float) $tps_sec;
    }
792658
static function sGetMicrotime()
    {
        list ($usec, $sec) = explode(" ", microtime());
        return (( float )$usec + ( float )$sec);
    }
1129551
public static function check(int $offsetSecond) : void
    {
        if ($offsetSecond < -59 || $offsetSecond > 59) {
            throw DateTimeException::fieldNotInRange(self::NAME, $offsetSecond, -59, 59);
        }
    }
1079567
public function setRetryWait($milliseconds)
    {
        $this->retryWait = (int) $milliseconds;
        $this->client->getConnection()->setRetryWait($milliseconds);

        return $this;
    }
1089783
def _microseconds_from_datetime(value):
    
    if not value.tzinfo:
        value = value.replace(tzinfo=UTC)
    # Regardless of what timezone is on the value, convert it to UTC.
    value = value.astimezone(UTC)
    # Convert the datetime to a microsecond timestamp.
    return int(calendar.timegm(value.timetuple()) * 1e6) + value.microsecond
729344
public static function minOf(LocalDate ...$dates) : LocalDate
    {
        if (! $dates) {
            throw new DateTimeException(__METHOD__ . ' does not accept less than 1 parameter.');
        }

        $min = LocalDate::max();

        foreach ($dates as $time) {
            if ($time->isBefore($min)) {
                $min = $time;
            }
        }

        return $min;
    }
677008
static public function microTime($isFormat = true)
    {
        if ($isFormat) {
            list($microSec, $sec) = explode(" ", microtime());
            return Format::datetime($sec) . ' ' . substr($microSec, 2, 6);
        } else {
            return microtime(true);
        }
    }
534165
public final function addSeconds( int $seconds = 1 )
      : DateTime
   {

      return $this->move( new \DateInterval( 'PT' . \abs( $seconds ) . 'S' ), $seconds < 0 );

   }
581577
public function setDisconnectTime($milliseconds = null)
    {
        if (is_integer($milliseconds)
             && $milliseconds >= self::DEF_DISCONNECT_TIME
        ) {
            $this->_disconnecttime = $milliseconds;
        } else {
            $this->_disconnecttime = self::DEF_DISCONNECT_TIME;
        }
        return $this->_disconnecttime;
    }
63154
private function setDateContext(\DateTime $dateContext = null)
    {
        if (!$dateContext) { // we havent set context so we need the default to be: now minus 15 mins, rounded to 5 min increment.
            $now = new \DateTime();
            $now->sub(new \DateInterval('PT15M'));
            // round down to 5 minute increment
            $now->setTime($now->format('H'), floor($now->format('i') / 5) * 5, 0);
            $dateContext = $now;
        }
        $this->dateContext = $dateContext;
    }
1030227
static function parse_microtime( $microtime ){
		list($usec, $sec) = explode( ' ', $microtime ); 
		$ms1 = (float) $usec * 1000;
		$ms2 = (float) $sec  * 1000;
		return $ms1 + $ms2;
	}
1079246
function setHMS( $hour, $min = 0, $sec = 0 )
    {
        $this->Time = ($hour % 24 ) * self::SECONDS_AN_HOUR + ($min % 60) * self::SECONDS_A_MINUTE + ($sec % 60);
        $this->IsValid = $this->Time >= 0;
    }