Updates the context with the current time.
502438
private function updateTime()
    {
        // Date string generation is (relatively) expensive. Since we only need HTTP
        // dates at a granularity of one second we're better off to generate this
        // information once per second and cache it.
        $this->currentTime = \time();
        $this->currentHttpDate = \gmdate("D, d M Y H:i:s", $this->currentTime) . " GMT";

        foreach ($this->callbacks as $callback) {
            $callback($this->currentTime, $this->currentHttpDate);
        }
    }
1000497
def set_timestamp_to_current(self):
        
        # Good form to add tzinfo
        self.timestamp = pytz.UTC.localize(datetime.datetime.utcnow())
1027352
protected function updateTimestamps()
    {
        $time = $this->freshTimestamp();

        if (! is_null(static::UPDATED_AT) && ! $this->hasChanged(static::UPDATED_AT)) {
            $this->setUpdatedAt($time);
        }

        if (! $this->exists && ! is_null(static::CREATED_AT) &&
            ! $this->hasChanged(static::CREATED_AT)) {
            $this->setCreatedAt($time);
        }
    }
1022007
@Override
	public void updateContext() {

		// Find the path to update
		String newInstancePath = "/" + this.instancePath.replaceFirst( "/[^/]+$", this.newInstanceName );

		Map<String,String> copy = new HashMap<>( this.context.instancePathToComponentName );
		for( Map.Entry<String,String> entry : copy.entrySet()) {
			if( ! entry.getKey().startsWith( this.instancePath + "/" )
					&& ! entry.getKey().equals( this.instancePath ))
				continue;

			String updatedPath = entry.getKey().replace( this.instancePath, newInstancePath );
			this.context.instancePathToComponentName.remove( entry.getKey());
			this.context.instancePathToComponentName.put( updatedPath, entry.getValue());
		}
	}
11221
def update(self, reset=True):
        
        if self.parent.info.dataset is not None:
            # read from the dataset, if available
            header = self.parent.info.dataset.header
            maximum = header['n_samples'] / header['s_freq']  # in s
            self.minimum = 0
            self.maximum = maximum
            self.start_time = self.parent.info.dataset.header['start_time']

        elif self.parent.notes.annot is not None:
            # read from annotations
            annot = self.parent.notes.annot
            self.minimum = annot.first_second
            self.maximum = annot.last_second
            self.start_time = annot.start_time

        # make it time-zone unaware
        self.start_time = self.start_time.replace(tzinfo=None)

        if reset:
            self.parent.value('window_start', 0)  # the only value that is reset

        self.display()
157370
protected function updateTimestamps()
    {
        $time = $this->freshTimestamp();

        if (! $this->isDirty($this->updatedAtColumn)) {
            $this->setUpdatedAt($time);
        }

        if (! $this->exists && ! $this->isDirty($this->createdAtColumn)) {
            $this->setCreatedAt($time);
        }
    }
192406
def set_update_time(self, update_time=None):
        
        if update_time and isinstance(update_time, (datetime.datetime,)):
            self.last_update_time = update_time
        else:
            self.last_update_time = datetime.datetime.utcnow()
828878
def update(call_time, exclusive_time = nil)
      self.call_count += 1
      self.total_call_time += call_time
      self.total_exclusive_time += exclusive_time

      t = @scoped ? exclusive_time : call_time
      self.min_call_time = t if call_count == 0 || t < min_call_time
      self.max_call_time = t if t > max_call_time
    end
1144402
function updateCallback(that) {
        var i;
        that.status = GameTimer.RUNNING;
        that.timePassed += that.update;
        that.timeLeft -= that.update;
        that.updateStart = J.now();
        // Fire custom hooks from the latest to the first if any.
        for (i = that.hooks.length; i > 0; i--) {
            that.fire(that.hooks[(i-1)]);
        }
        // Fire Timeup Event
        if (that.timeLeft <= 0) {
            that.doTimeup();
            return false;
        }
        else {
            return true;
        }
    }
160163
protected void update() {
		_updated = true;
		if (System.currentTimeMillis() > _lastDumpTime + _interval) {
			try {
				dump();
			} catch (InvocationException ex) {
				// Todo: decide what to do
			}
		}
	}
377008
public void update(HttpResponse response) {
		long time = System.currentTimeMillis();
		long networkTime = time - contextTsCurrent.get();
		contextMsNetwork.set(contextMsNetwork.get() + networkTime);
		contextTsCurrent.set(time);
		
		StringBuilder cookiesDump = new StringBuilder();
		for (Header h : response.getAllHeaders()) {
			if ("Set-Cookie".equalsIgnoreCase(h.getName())) {
				try {
					Map<String, Cookie> cookiez = getServerCookiesFrom(h);
					requestCookies.get().putAll(cookiez);
					responseCookies.get().putAll(cookiez);
					cookiesDump.append(h.toString()).append(";");
				} catch (MalformedCookieException e) {
					log.error("discarding malformed cookie", e);
				}
			}
		}

		if (verbose) log.info("    Time " + String.valueOf(time - contextTsStart.get()) + " (+" + networkTime + "n) <<< [" + contextUrl.get() + "] <<< " + contextRequest.get() + ". Set-Cookie to thread local: " + cookiesDump.toString());
	}
266569
def update(self):
        """"""
        if self.input_method == 'local':
            # Only refresh:
            # * if there is not other scanning thread
            # * every refresh seconds (define in the configuration file)
            if self._thread is None:
                thread_is_running = False
            else:
                thread_is_running = self._thread.isAlive()
            if self.timer_ports.finished() and not thread_is_running:
                # Run ports scanner
                self._thread = ThreadScanner(self.stats)
                self._thread.start()
                # Restart timer
                if len(self.stats) > 0:
                    self.timer_ports = Timer(self.stats[0]['refresh'])
                else:
                    self.timer_ports = Timer(0)
        else:
            # Not available in SNMP mode
            pass

        return self.stats
284255
def update(self):
        """"""
        # Had to convert it to string because datetime is not JSON serializable
        self.stats = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
        # Add the time zone (issue #1249 and issue #1337)
        if 'tmzone' in localtime():
            self.stats += ' {}'.format(localtime().tm_zone)
        elif len(tzname) > 0:
            self.stats += ' {}'.format(tzname[1])

        return self.stats
38115
def update_clock(self, dt):
        
        dt = dt.astimezone(self.tzinfo)
        fmt = "%H:%M"
        if self.show_seconds:
            fmt = "%H:%M:%S"

        self.time_txt.text = dt.strftime(fmt)

        suppl_text = "{0} {1}".format(dt.strftime("%Y-%m-%d"), self.timezone)
        self.suppl_txt.text = suppl_text

        self.viewer.redraw(whence=3)
417854
protected function updateTimestamps() {
        $time = $this->freshTimestamp();
        if ($this->isEmpty(static::UPDATED_AT)
            && $this->hasColumn(static::UPDATED_AT)) {
            $this->setUpdatedAt($time);
        }

        if ($this->isNewRecord
            && $this->isEmpty(static::CREATED_AT)
            && $this->hasColumn(static::CREATED_AT)) {
            $this->setCreatedAt($time);
        }
    }
172461
def start(self, key=None, **params):
		""""""
		self.params.update(**params)
		key = key or self.stack_key
		if key is not None:
			self.current_times[key] = time()
106682
protected void update (float time)
    {
        // update fade, which may stop playing
        updateFade(time);
        if (_state != AL10.AL_PLAYING) {
            return;
        }

        // find out how many buffers have been played and unqueue them
        int played = _source.getBuffersProcessed();
        if (played == 0) {
            return;
        }
        for (int ii = 0; ii < played; ii++) {
            _source.unqueueBuffers(_buffers[_qidx]);
            _qidx = (_qidx + 1) % _buffers.length;
            _qlen--;
        }

        // enqueue up to the number of buffers played
        queueBuffers(played);

        // find out if we're still playing; if not and we have buffers queued, we must restart
        _state = _source.getSourceState();
        if (_qlen > 0 && _state != AL10.AL_PLAYING) {
            play();
        }
    }