Updates modified timestamp on current tag and all of its parents
Expensive to run through API, so SQL takes care of it
546609
public function updateModified()
    {
        $pathArray = explode( '/', trim( $this->attribute( 'path_string' ), '/' ) );

        if ( $this->attribute( 'main_tag_id' ) > 0 )
            array_push( $pathArray, $this->attribute( 'main_tag_id' ) );

        if ( !empty( $pathArray ) )
        {
            $db = eZDB::instance();
            $db->query( "UPDATE eztags SET modified = " . time() .
                        " WHERE " . $db->generateSQLINStatement( $pathArray, 'id', false, true, 'int' ) );
        }
    }
216499
@Override
    public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException
    {
        checkParameterBounds(parameterIndex);
        this.parameters[parameterIndex-1] = x == null ? VoltType.NULL_TIMESTAMP : x;
    }
1198376
def _update_time_stamp(self, hash_value):
        
        db_name = self._database_from_key(hash_value)
        if not db_name:
            db_name=':memory:'

        def _update():
            import sqlite3
            try:
                with sqlite3.connect(db_name, timeout=self.lru_timeout) as conn:
                    """ last_read is a result of time.time()"""
                    conn.execute('CREATE TABLE IF NOT EXISTS usage '
                                 '(hash VARCHAR(32), last_read FLOAT)')
                    conn.commit()
                    cur = conn.execute('select * from usage where hash=?', (hash_value,))
                    row = cur.fetchone()
                    if not row:
                        conn.execute("insert into usage(hash, last_read) values(?, ?)", (hash_value, time.time()))
                    else:
                        conn.execute("update usage set last_read=? where hash=?", (time.time(), hash_value))
                    conn.commit()
            except sqlite3.OperationalError:
                # if there are many jobs to write to same database at same time, the timeout could be hit
                logger.debug('could not update LRU info for db %s', db_name)

        # this could lead to another (rare) race condition during cleaning...
        #import threading
        #threading.Thread(target=_update).start()
        _update()
941030
def set_timestamp(self, timestamp=str(datetime.datetime.utcfromtimestamp(time.time()))):
        
        self.timestamp = timestamp
931228
def update(uid, post_data):
        '''
        
        '''
        raw_rec = TabTag.get(TabTag.uid == uid)
        entry = TabTag.update(
            name=post_data['name'] if 'name' in post_data else raw_rec.name,
            slug=post_data['slug'] if 'slug' in post_data else raw_rec.slug,
            order=post_data['order'] if 'order' in post_data else raw_rec.order,
            kind=post_data['kind'] if 'kind' in post_data else raw_rec.kind,
            pid=post_data['pid'],
        ).where(TabTag.uid == uid)
        entry.execute()
1061640
def get_modified_date(parsed, raw):
	''
	if parsed: return feedparser_ts(parsed)
	if not raw: return None

	# Parse weird timestamps that feedparser can't handle, e.g.: July 30, 2013
	ts, val = None, raw.replace('_', ' ')
	if not ts:
		# coreutils' "date" parses virtually everything, but is more expensive to use
		from subprocess import Popen, PIPE
		with open(os.devnull, 'w') as devnull:
			proc = Popen(['date', '+%s', '-d', val], stdout=PIPE, stderr=devnull)
			val = proc.stdout.read()
			if not proc.wait():
				ts = datetime.fromtimestamp(int(val.strip()), tz=timezone.utc)
	if ts: return ts
	raise ValueError('Unrecognized raw value format: {0!r}'.format(val))
977070
private ImmutableTriple<Integer,ResultSet,SQLWarning> update(final String sql, final int autoGeneratedKeys) throws SQLException {

        checkClosed();

        try {
            final UpdateResult res = this.handler.whenSQLUpdate(sql, NO_PARAMS);
            final SQLWarning w = res.getWarning();
            final ResultSet k = (res.generatedKeys == null 
                                 || autoGeneratedKeys == NO_GENERATED_KEYS) 
                ? EMPTY_GENERATED_KEYS.withStatement(this) 
                : res.generatedKeys.resultSet().withStatement(this);
            
            return ImmutableTriple.of(res.getUpdateCount(), k, w);
        } catch (SQLException se) {
            throw se;
        } catch (Exception e) {
            throw new SQLException(e.getMessage(), e);
        } // end of catch
    }
536033
def make_timestamp_columns():
    """"""
    return (
        Column('created_at', DateTime, default=func.utcnow(), nullable=False),
        Column('updated_at', DateTime, default=func.utcnow(), onupdate=func.utcnow(), nullable=False),
    )
1370102
def __access(self, ts):
    
    with self.connection:
      self.connection.execute("INSERT OR REPLACE INTO access_timestamp (timestamp, domain) VALUES (?, ?)",
                              (ts, self.domain))
1068845
def update_stale(self):
        """"""
        # Some events don't post an inactive XML, only active.
        # If we don't get an active update for 5 seconds we can
        # assume the event is no longer active and update accordingly.
        for etype, echannels in self.event_states.items():
            for eprop in echannels:
                if eprop[3] is not None:
                    sec_elap = ((datetime.datetime.now()-eprop[3])
                                .total_seconds())
                    # print('Seconds since last update: {}'.format(sec_elap))
                    if sec_elap > 5 and eprop[0] is True:
                        _LOGGING.debug('Updating stale event %s on CH(%s)',
                                       etype, eprop[1])
                        attr = [False, eprop[1], eprop[2],
                                datetime.datetime.now()]
                        self.update_attributes(etype, eprop[1], attr)
                        self.publish_changes(etype, eprop[1])
1098815
def _mark_updated(self):
        """"""
        timestamp = datetime.datetime.utcnow().isoformat()
        DB.set_hash_value(self.key, 'updated', timestamp)
85100
function  updateTemplate(tbName, schema, columns, inData)  {
	var  insertObj = {},
		 jsonObj = {},
		 schemaCol = schema.columns,
		 isNewSQL = schemaCol.indexOf('_c_json') >= 0;

	// if columns are specified in the SQL expression, remove input data which are
	// not  specified in columns
	if (columns)  {
		var  ndata = {},
			 keys = Object.getOwnPropertyNames(inData);
		for (var i in keys)  {
			var  key = keys[i];
			if (columns.indexOf(key) >= 0)
				ndata[key] = inData[key];
		}
		inData = ndata;
	}
	
	// needs to decide what goes to sql columns and what goes to the json column
	var  keys = Object.getOwnPropertyNames(inData);
	for (var i in keys)  {
		var  key = keys[i];
		if (schemaCol.indexOf(key) >= 0)
			insertObj[key] = inData[key];
		else  if (isNewSQL)
			jsonObj[key] = inData[key];
	}

	var  insertCol = Object.keys( insertObj );
	if (Object.keys(jsonObj).length)  {
		// prepare the json column
		insertCol.push('_c_json');
		//insertObj._c_json = JSON.stringify(jsonObj);
	}

	var  updateSBI = soar.sqlTemplate(tbName);
	updateSBI.column( insertCol );

	return  {sbi: updateSBI, data: insertObj, _c_json: jsonObj};
}
538532
def set_timestamp(self,timestamp=None):
        
        if timestamp is None:
            import time
            timestamp = time.strftime('%Y-%m-%dT%H:%M:%S%Z')
        self.node.set('timestamp',timestamp)
851161
private void update() {
        synchronized (lock) {
            if (!observing) { return; }

            try {
                Log.i(DOMAIN, "%s: Querying...", this);
                final ResultSet oldResultSet = resultSet;
                final ResultSet newResultSet = (oldResultSet == null) ? query.execute() : oldResultSet.refresh();

                willUpdate = false;
                lastUpdatedAt = System.currentTimeMillis();

                if (newResultSet != null) {
                    if (oldResultSet != null) { Log.i(DOMAIN, "%s: Changed!", this); }
                    resultSet = newResultSet;
                    changeNotifier.postChange(new QueryChange(this.query, resultSet, null));
                }
                else {
                    Log.i(DOMAIN, "%s: ...no change", this);
                }
            }
            catch (CouchbaseLiteException e) {
                changeNotifier.postChange(new QueryChange(this.query, null, e));
            }
        }
    }
1286636
def timestamps(self, use_current=True):
        
        if use_current:
            self.timestamp("created_at").use_current()
            self.timestamp("updated_at").use_current()
        else:
            self.timestamp("created_at")
            self.timestamp("updated_at")
31938
def update(request)
      timestamp = request.first(options[:field])
      @hour_frequencies[timestamp.to_s[8..9].to_i] += 1
      @first = timestamp if timestamp < @first
      @last  = timestamp if timestamp > @last
    end
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);
}