Return Etag and Last-Modified values (based on mtime).
335243
def conditions(self, full_path, environ):
        """"""
        mtime = int(time.time())
        return str(mtime), rfc822.formatdate(mtime)
473834
def last_datetime(self):
        """"""
        from datetime import datetime

        try:
            return datetime.fromtimestamp(self.state.lasttime)
        except TypeError:
            return None
539127
def _check_guts_toc_mtime(attr, old, toc, last_build, pyc=0):
    
    for (nm, fnm, typ) in old:
        if mtime(fnm) > last_build:
            logger.info("building because %s changed", fnm)
            return True
        elif pyc and mtime(fnm[:-1]) > last_build:
            logger.info("building because %s changed", fnm[:-1])
            return True
    return False
317166
def get_recent_mtime(t):
    '''
    '''
    if isinstance(t, int):
        # ignore micro seconds
        if len(str(t)) == 13:
            t = t // 1000
        t = datetime.datetime.fromtimestamp(t)
    now = datetime.datetime.now()
    delta = now - t
    if delta.days == 0:
        return datetime.datetime.strftime(t, '%H:%M:%S')
    elif now.year == t.year:
        return datetime.datetime.strftime(t, '%b %d')
    else:
        return datetime.datetime.strftime(t, '%b %d %Y')
481009
def str_eta(self):
        """"""
        if self.done:
            return eta_hms(self._eta.elapsed, always_show_hours=True, hours_leading_zero=True)
        if not self._eta_string:
            return ''
        return '{0} ETA'.format(self._eta_string)
283478
def last_modified_date(filename):
    """"""
    mtime = os.path.getmtime(filename)
    dt = datetime.datetime.utcfromtimestamp(mtime)
    return dt.replace(tzinfo=pytz.utc)
767471
def modification_time(self):
    """"""
    timestamp = self._fsapfs_file_entry.get_modification_time_as_integer()
    return dfdatetime_apfs_time.APFSTime(timestamp=timestamp)
1097151
def access_time(self):
    """"""
    if self._stat_info is None:
      return None

    timestamp = int(self._stat_info.st_atime)
    return dfdatetime_posix_time.PosixTime(timestamp=timestamp)
530447
def get_last_modified_unix_sec():
    """"""
    path = request.args.get("path")
    if path and os.path.isfile(path):
        try:
            last_modified = os.path.getmtime(path)
            return jsonify({"path": path, "last_modified_unix_sec": last_modified})

        except Exception as e:
            return client_error({"message": "%s" % e, "path": path})

    else:
        return client_error({"message": "File not found: %s" % path, "path": path})
12410
def _get_mtime():
    
    return os.path.exists(RPM_PATH) and int(os.path.getmtime(RPM_PATH)) or 0
761002
def lastmod(self, tag):
        """"""
        lastitems = EntryModel.objects.published().order_by('-modification_date').filter(tags=tag).only('modification_date')
        return lastitems[0].modification_date
25348
def _max_timestamps(dirname_full, remove, compare_tstamp):
    """"""
    tstamp = _get_timestamp_cached(dirname_full, remove)
    return max_none((tstamp, compare_tstamp))
1095876
def get_days_since_last_modified(filename):
        
        now = datetime.now()
        last_modified = datetime.fromtimestamp(os.path.getmtime(filename))
        return (now - last_modified).days
445290
def with_timestamps(self, created_at=None, updated_at=None):
        
        if not created_at:
            created_at = self.created_at()

        if not updated_at:
            updated_at = self.updated_at()

        return self.with_pivot(created_at, updated_at)
1355691
def get_last_doc(self):
        """"""
        return max(self.doc_dict.values(), key=lambda x: x.ts).meta_dict
1311537
def rfc_from_timestamp(timestamp):
    
    last_modified_date = datetime.utcfromtimestamp(timestamp)
    last_modified_str = last_modified_date.strftime(
        '%a, %d %b %Y %H:%M:%S GMT')
    return last_modified_str
856233
def _ParseTimeRange(self, timerange):
    """"""
    if timerange is None:
      timerange = (None, None)

    from_time, to_time = timerange
    if not from_time:
      from_time = rdfvalue.RDFDatetime().FromSecondsSinceEpoch(0)

    if not to_time:
      to_time = rdfvalue.RDFDatetime().FromSecondsSinceEpoch(sys.maxsize)

    return (from_time, to_time)