Update user's last_login timestamp
544422
function touch()
    {
        if ($this->ID) {
            $this->db->query(
                "UPDATE ".$this->db->table_name('users', true).
                " SET `last_login` = ".$this->db->now().
                " WHERE `user_id` = ?",
                $this->ID);
        }
    }
1370102
def __access(self, ts):
    
    with self.connection:
      self.connection.execute("INSERT OR REPLACE INTO access_timestamp (timestamp, domain) VALUES (?, ?)",
                              (ts, self.domain))
1334475
@Override
    public synchronized void updateLastAccessTime(long accessTime) {
        if (_lastAccessedTime == 0) { // newly created session object
            _lastAccessedTime = accessTime;
        } else {
            _lastAccessedTime = _currentAccessTime;
        }
        _currentAccessTime = accessTime;
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
            LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, methodNames[UPDATE_LAST_ACCESS_TIME], "" + accessTime);
        }
    }
604510
function bump($user_id = 0)
	{
		global $db, $user;

		$current_time = time();
		if ($user_id == 0)
			$user_id = $user->data['user_id'];

		$db->sql_transaction('begin');

		$sql = 'UPDATE ' . POSTS_TABLE . "
		SET post_time = $current_time
		WHERE post_id = {$this->topic_last_post_id}
		AND topic_id = {$this->topic_id}";
		$db->sql_query($sql);

		$this->topic_bumped = 1;
		$this->topic_bumper = $user_id;
		$this->topic_last_post_time = $current_time;
		$sql = 'UPDATE ' . TOPICS_TABLE . "
		SET topic_last_post_time = $current_time,
		topic_bumped = 1,
		topic_bumper = $user_id
		WHERE topic_id = $topic_id";
		$db->sql_query($sql);

		update_post_information('forum', $this->forum_id);

		$sql = 'UPDATE ' . USERS_TABLE . "
		SET user_lastpost_time = $current_time
		WHERE user_id = $user_id";
		$db->sql_query($sql);

		$db->sql_transaction('commit');

		markread('post', $this->forum_id, $this->topic_id, $current_time, $user_id);

		add_log('mod', $this->forum_id, $this->topic_id, 'LOG_BUMP_TOPIC', $this->topic_title);
	}
335414
public function logCurrentUserLastSeenTime()
    {
        $module = Common::getRequestVar('module', false);
        $currentUserLogin = Piwik::getCurrentUserLogin();

        // only log time for non-anonymous visits to the reporting UI
        if ($module == 'API'
            || $module == 'Proxy'
            || Piwik::isUserIsAnonymous()
        ) {
            return;
        }

        // get the last known time
        $optionName = self::OPTION_PREFIX . $currentUserLogin;
        $lastSeen = Option::get($optionName);

        // do not log if last known time is less than N minutes from now (so we don't make too many
        // queries)
        if (time() - $lastSeen <= self::LAST_TIME_SAVE_DELTA) {
            return;
        }

        // log last seen time (Note: autoload is important so the Option::get above does not result in
        // a separate query)
        Option::set($optionName, time(), $autoload = 1);
    }
439067
public function setDateLastLogin($date_last_login){
        if(!$this->setModified('date_last_login', $date_last_login)->isModified()){
            return $this;
        }
        $this->date_last_login = $date_last_login;

        return $this;
    }
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);
        }
    }
463997
def current_timestamp():
    """"""
    now = datetime.utcnow()
    timestamp = now.isoformat()[0:19] + 'Z'

    debug("generated timestamp: {now}".format(now=timestamp))

    return timestamp
44916
def _dump_query_timestamps(self, current_time: float):
        """"""
        windows = [10, 11, 15, 20, 30, 60]
        print("GraphQL requests:", file=sys.stderr)
        for query_hash, times in self._graphql_query_timestamps.items():
            print("  {}".format(query_hash), file=sys.stderr)
            for window in windows:
                reqs_in_sliding_window = sum(t > current_time - window * 60 for t in times)
                print("    last {} minutes: {} requests".format(window, reqs_in_sliding_window), file=sys.stderr)
705240
def user_update(self, display_name=None, first_name=None, last_name=None,
                    email=None, password=None, current_password=None,
                    birth_date=None, gender=None, website=None, subdomain=None,
                    location=None, newsletter=None, primary_usage=None,
                    timezone=None):
        
        return self.request("user/update", QueryParams({
            "display_name": display_name,
            "first_name": first_name,
            "last_name": last_name,
            "email": email,
            "password": password,
            "current_password": current_password,
            "birth_date": birth_date,
            "gender": gender,
            "website": website,
            "subdomain": subdomain,
            "location": location,
            "newsletter": newsletter,
            "primary_usage": primary_usage,
            "timezone": timezone
        }))
87652
public function updateLastLogin(string $time = null): void
    {
        $this->timestamps = false;
        $this->last_login = is_null($time) ? $this->freshTimestamp() : $time;
        $this->save();

        $this->updateLastActivity();
    }
789511
function (account, data, conn) {

	//if (l_logins.hasOwnProperty(account) === true)
		//return false;
	
	// check if user's unique data exists
	if (typeof data.data !== 'object') {
		LOG.error('data field does not exist, cannot add login data');
		return false;
	}
	
	LOG.warn('account: ' + account + ' data:', 'addLogin');
	LOG.warn(data);
	
	// attach login name to connection
	// NOTE: we attach connection object to the data stored in memory (not clean?)
	if (conn) {
		// NOTE: we use session because this request could come from an HTTP request
		// that does not have a persistent connectino record in SR.Conn
		SR.Conn.setSessionName(conn, account);
		data._conn = conn;
	}
	
	l_logins[account] = data;
	LOG.warn('user [' + account + '] login success, total count: ' + Object.keys(l_logins).length, 'user');

	delete data._conn;
	//console.log(data);
	
	// error check: make sure lastStatus field exists
	if (data.hasOwnProperty('lastStatus') === false || data.lastStatus === null) 
		data.lastStatus = {loginCount: 0};
	
	data.lastStatus.loginIP = conn.host;
	data.lastStatus.loginCount = data.lastStatus.loginCount + 1;
	data.lastStatus.time = conn.time;

	SR.DB.updateData(SR.Settings.DB_NAME_ACCOUNT, {account: account}, data,
					 	function () {
					 	},
					 	function () {
					 	});	

	return true;
}
838702
def update_time_reset_passwd(user_name, the_time):
        '''
        
        '''
        entry = TabMember.update(
            time_reset_passwd=the_time,
        ).where(TabMember.user_name == user_name)
        try:
            entry.execute()
            return True
        except:
            return False
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),
    )
949571
public function lastLogin()
    {
        //Checks if login logs are enabled
        if (!getConfig('users.login_log')) {
            $this->Flash->error(I18N_DISABLED);

            return $this->redirect(['_name' => 'dashboard']);
        }

        $this->set('loginLog', $this->LoginRecorder->setConfig('user', $this->Auth->user('id'))->read());
    }
283478
def last_modified_date(filename):
    """"""
    mtime = os.path.getmtime(filename)
    dt = datetime.datetime.utcfromtimestamp(mtime)
    return dt.replace(tzinfo=pytz.utc)
24304
public function setLastLogin($v)
    {
        $dt = PropelDateTime::newInstance($v, null, 'DateTime');
        if ($this->last_login !== null || $dt !== null) {
            $currentDateAsString = ($this->last_login !== null && $tmpDt = new DateTime($this->last_login)) ? $tmpDt->format('Y-m-d H:i:s') : null;
            $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;
            if ($currentDateAsString !== $newDateAsString) {
                $this->last_login = $newDateAsString;
                $this->modifiedColumns[] = UserPeer::LAST_LOGIN;
            }
        } // if either are not null


        return $this;
    }