TODO: Find all usage of this and ensure they use the same timestamp for saving events and runnign interaction queries.
167707
public synchronized void storeEventForCurrentAppVersion(double timestamp, int versionCode, String versionName, String eventLabel) {
		EventRecord eventRecord = events.get(eventLabel);
		if (eventRecord == null) {
			eventRecord = new EventRecord();
			events.put(eventLabel, eventRecord);
		}
		eventRecord.update(timestamp, versionName, versionCode);
		notifyDataChanged();
	}
474197
public void recordGetAllTime(long timeNS,
                                 int requested,
                                 int returned,
                                 long totalValueBytes,
                                 long totalKeyBytes) {
        recordTime(Tracked.GET_ALL,
                   timeNS,
                   requested - returned,
                   totalValueBytes,
                   totalKeyBytes,
                   requested);
    }
1287899
private long updateBaseTime(final long timestamp) {
    // We force the starting timestamp to be on a MAX_TIMESPAN boundary
    // so that all TSDs create rows with the same base time. Otherwise
    // we'd need to coordinate TSDs to avoid creating rows that cover
    // overlapping time periods.
    final long base_time = timestamp - (timestamp % Const.MAX_TIMESPAN);
    // Clone the row key since we're going to change it. We must clone it
    // because the HBase client may still hold a reference to it in its
    // internal datastructures.
    row = Arrays.copyOf(row, row.length);
    Bytes.setInt(row, (int) base_time, Const.SALT_WIDTH() + tsdb.metrics.width());
    RowKey.prefixKeyWithSalt(row); // in case the timestamp will be involved in
                                   // salting later
    tsdb.scheduleForCompaction(row, (int) base_time);
    return base_time;
  }
913872
@Override
	public void updateTimestamp(final String columnLabel, final Timestamp x) throws SQLException {
		wrapped.updateTimestamp(columnLabel, x);
	}
1114901
function () {
            var cfg = this._cfg;
            var waiEscapeMsg = cfg.waiEscapeMsg;
            var confirmed = !(cfg.waiAria && waiEscapeMsg);
            if (!confirmed) {
                var now = new Date().getTime();
                confirmed = this._firstEscapeTime && (now - this._firstEscapeTime) <= 3000;
                if (!confirmed) {
                    this._firstEscapeTime = now;
                    this.waiReadText(waiEscapeMsg);
                }
            }
            if (confirmed) {
                this._firstEscapeTime = null;
                this.actionClose();
            }
        }
624997
function timestampsPlugin(schema, options) {

  // Add the fields to the schema
  schema.add({
    createdAt: {
      type: Date,
      'default': Date.now
    },
    updatedAt: {
      type: Date,
      'default': Date.now
    },
    deletedAt: {
      type: Date,
      sparse: true
    }
  });

  // Define the pre save hook
  schema.pre('save', function (next) {
    this.updatedAt = new Date();
    next();
  });

  // Create an index on all the paths
  schema.path('createdAt').index(true);
  schema.path('updatedAt').index(true);
  schema.path('deletedAt').index(true);
}
216499
@Override
    public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException
    {
        checkParameterBounds(parameterIndex);
        this.parameters[parameterIndex-1] = x == null ? VoltType.NULL_TIMESTAMP : x;
    }
388114
function (pointer, event, eventTarget) {
            if (this.prevTap
                && event.clientX === this.prevTap.clientX
                && event.clientY === this.prevTap.clientY
                && eventTarget   === this.prevTap.target) {

                this.downTargets[0] = eventTarget;
                this.downTimes[0] = new Date().getTime();
                this.collectEventTargets(pointer, event, eventTarget, 'tap');
            }
        }
239884
def ParseAutofillRow(
      self, parser_mediator, query, row, **unused_kwargs):
    
    query_hash = hash(query)

    event_data = ChromeAutofillEventData()
    event_data.field_name = self._GetRowValue(query_hash, row, 'name')
    event_data.value = self._GetRowValue(query_hash, row, 'value')
    event_data.usage_count = self._GetRowValue(query_hash, row, 'count')
    event_data.query = query

    # Create one event for the first time an autofill entry was used
    timestamp = self._GetRowValue(query_hash, row, 'date_created')
    date_time = dfdatetime_posix_time.PosixTime(timestamp=timestamp)
    event = time_events.DateTimeValuesEvent(
        date_time, definitions.TIME_DESCRIPTION_CREATION)
    parser_mediator.ProduceEventWithEventData(event, event_data)

    # If the autofill value has been used more than once, create another
    # event for the most recent time it was used.
    if event_data.usage_count > 1:
      timestamp = self._GetRowValue(query_hash, row, 'date_last_used')
      date_time = dfdatetime_posix_time.PosixTime(timestamp=timestamp)
      event = time_events.DateTimeValuesEvent(
          date_time, definitions.TIME_DESCRIPTION_LAST_USED)
      parser_mediator.ProduceEventWithEventData(event, event_data)
742402
def save(self):
        

        if self.object_id:
            # update event
            if not self._track_changes:
                return True  # there's nothing to update
            url = self.build_url(
                self._endpoints.get('event').format(id=self.object_id))
            method = self.con.patch
            data = self.to_api_data(restrict_keys=self._track_changes)
        else:
            # new event
            if self.calendar_id:
                url = self.build_url(
                    self._endpoints.get('event_calendar').format(
                        id=self.calendar_id))
            else:
                url = self.build_url(self._endpoints.get('event_default'))
            method = self.con.post
            data = self.to_api_data()

        response = method(url, data=data)
        if not response:
            return False

        self._track_changes.clear()  # clear the tracked changes

        if not self.object_id:
            # new event
            event = response.json()

            self.object_id = event.get(self._cc('id'), None)

            self.__created = event.get(self._cc('createdDateTime'), None)
            self.__modified = event.get(self._cc('lastModifiedDateTime'), None)

            self.__created = parse(self.__created).astimezone(
                self.protocol.timezone) if self.__created else None
            self.__modified = parse(self.__modified).astimezone(
                self.protocol.timezone) if self.__modified else None
        else:
            self.__modified = self.protocol.timezone.localize(dt.datetime.now())

        return True
389600
function timestamp () {
  const date = new Date()

  return [
    zeropad(date.getHours()),
    zeropad(date.getMinutes()),
    zeropad(date.getSeconds())
  ].join(':')
}
1335621
@Override
    public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException
    {
        checkParameterBounds(parameterIndex);
        throw SQLError.noSupport();
    }
152235
@Override
    public Timestamp getTimestamp(int parameterIndex, Calendar cal) throws SQLException
    {
        checkClosed();
        throw SQLError.noSupport();
    }
468215
public function initializeTimestamps()
    {
        if (is_null($this->createdAt) && is_null($this->updatedAt)) {
            $this->createdAt = Carbon::now();
            $this->updatedAt = Carbon::now();
        }
    }
554288
function queryState(defaults, options) {
  options = options || {};
  var history = options.history || windowHistory(defaults, options);
  validateHistoryAPI(history);

  history.onChanged(updateQuery)

  var query = history.get() || Object.create(null);

  var api = {

    /**
     * Gets current state.
     *
     * @param {string?} keyName if present then value for this key is returned.
     * Otherwise the entire app state is returned.
     */
    get: getValue,

    /**
     * Merges current app state with new key/value.
     *
     * @param {string} key name
     * @param {string|number|date} value
     */
    set: setValue,

    /**
     * Removes value from the query string
     */
    unset: unsetValue,

    /**
     * Similar to `set()`, but only sets value if it was not set before.
     *
     * @param {string} key name
     * @param {string|number|date} value
     */
    setIfEmpty: setIfEmpty,

    /**
     * Releases all resources acquired by query state. After calling this method
     * no hash monitoring will happen and no more events will be fired.
     */
    dispose: dispose,

    onChange: onChange,
    offChange: offChange,

    getHistoryObject: getHistoryObject,
  }

  var eventBus = eventify({});

  return api;

  function onChange(callback, ctx) {
    eventBus.on('change', callback, ctx);
  }

  function offChange(callback, ctx) {
    eventBus.off('change', callback, ctx)
  }

  function getHistoryObject() {
    return history;
  }

  function dispose() {
    // dispose all history listeners
    history.dispose();

    // And remove our own listeners
    eventBus.off();
  }

  function getValue(keyName) {
    if (keyName === undefined) return query;

    return query[keyName];
  }

  function setValue(keyName, value) {
    var keyNameType = typeof keyName;

    if (keyNameType === 'object') {
      Object.keys(keyName).forEach(function(key) {
        query[key] = keyName[key];
      });
    } else if (keyNameType === 'string') {
      query[keyName] = value;
    }

    history.set(query);

    return api;
  }

  function unsetValue(keyName) {
    if (!(keyName in query)) return; // nothing to do

    delete query[keyName];
    history.set(query);

    return api;
  }

  function updateQuery(newAppState) {
    query = newAppState;
    eventBus.fire('change', query);
  }

  function setIfEmpty(keyName, value) {
    if (typeof keyName === 'object') {
      Object.keys(keyName).forEach(function(key) {
        // TODO: Can I remove code duplication? The main reason why I don't
        // want recursion here is to avoid spamming `history.set()`
        if (key in query) return; // key name is not empty

        query[key] = keyName[key];
      });
    }

    if (keyName in query) return; // key name is not empty
    query[keyName] = value;

    history.set(query);

    return api;
  }
}
773532
@Override
    public void setTimestamp(String parameterName, Timestamp x) throws SQLException
    {
        checkClosed();
        throw SQLError.noSupport();
    }
1088892
@Override
	public Timestamp getTimestamp(final int columnIndex, final Calendar cal) throws SQLException {
		return wrapped.getTimestamp(columnIndex, cal);
	}