If timestamp is set and the relative age is > 0, record age of the
        message coming in
189068
def _maybe_set_message_age(self):
        
        if self._message.properties.timestamp:
            message_age = float(
                max(self._message.properties.timestamp, time.time()) -
                self._message.properties.timestamp)
            if message_age > 0:
                self.measurement.add_duration(
                    self.message_age_key(), message_age)
477306
def touch(filename, timestamp):
    """"""
    if timestamp is not None:
        timestamp = (timestamp, timestamp)  # atime, mtime

    from os import utime
    utime(filename, timestamp)
266050
def timestamp(self, timestamp):
        """"""
        if timestamp is None:
            self._timestamp = datetime.utcnow()
        elif isinstance(timestamp, datetime):
            self._timestamp = timestamp
        else:
            self._timestamp = datetime.strptime(timestamp, fmt)
598718
def timestamp
      if File.exist?(name)
        File.mtime(name.to_s)
      else
        Rake::LATE
      end
    end
850604
def duration(self):
        
        if self.ended_timestamp is None:
            return datetime.datetime.utcnow() - self.message.created_at
        else:
            return self.ended_timestamp - self.message.created_at
459623
def __exists_row_not_too_old(self, row):
        
        if row is None:
            return False
        record_time = dateutil.parser.parse(row[2])
        now = datetime.datetime.now(dateutil.tz.gettz())
        age = (record_time - now).total_seconds()
        if age > self.max_age:
            return False

        return True
389882
private Long getLastUpdateTime(String sessionId) {
        if (lastUpdateForSession != null && sessionId != null && lastUpdateForSession.containsKey(sessionId)) {
            return lastUpdateForSession.get(sessionId);
        } else {
            return -1L;
        }
    }
410884
def timestamp(self, name, value):
        
        counter = self.get(name, CounterType.Timestamp)
        counter.time = value if value != None else datetime.datetime.utcnow()
        self._update()
1302882
def check_date (self):
        
        now = datetime.date.today()
        if now.day == 7 and now.month == 1:
            msg = _("Happy birthday for LinkChecker, I'm %d years old today!")
            self.comment(msg % (now.year - 2000))
245594
def timestamp(self):
        """"""
        timestamp = self.header[4] << 24 | self.header[5] << 16 | self.header[6] << 8 | self.header[7]
        return int(timestamp)
822722
def _VerifyRecord(self, pls_record):
    
    # Verify that the timestamp is no more than six years into the future.
    # Six years is an arbitrary time length just to evaluate the timestamp
    # against some value. There is no guarantee that this will catch everything.
    # TODO: Add a check for similarly valid value back in time. Maybe if it the
    # timestamp is before 1980 we are pretty sure it is invalid?
    # TODO: This is a very flaky assumption. Find a better one.
    future_timestamp = (
        timelib.Timestamp.GetNow() + self._SIX_YEARS_IN_MICRO_SECONDS)

    if pls_record.last_written_time > future_timestamp:
      return False

    # Take the first word from the query field and attempt to match that against
    # known query keywords.
    first_word, _, _ = pls_record.query.partition(' ')

    if first_word.lower() not in self._PLS_KEYWORD:
      return False

    return True
303788
def last_updated(self):
        '''
        
        '''
        derived_path = self.context.request.url
        timestamp_key = self.timestamp_key_for(derived_path)

        if self.exists(self.timestamp_key_for, derived_path):
            return self.storage.get(timestamp_key)

        return None
959042
def is_timestamp(instance):
    """"""
    if not isinstance(instance, (int, str)):
        return True
    return datetime.fromtimestamp(int(instance))
478153
def SetLowerTimestamp(cls, timestamp):
    """"""
    if not hasattr(cls, '_lower'):
      cls._lower = timestamp
      return

    if timestamp < cls._lower:
      cls._lower = timestamp
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")
533573
function (timestamp) {
        var date = (new Date(timestamp)).toDateString();
        return {
            msg       : date,
            msgLength : date.length
        };
    }
406580
def request_timestamp(self, lock):
        '''
        '''
        ts = self.requests[hookenv.local_unit()].get(lock, None)
        if ts is not None:
            return datetime.strptime(ts, _timestamp_format)