Get last modification of cache file with TLDs.

        :return: Date and time of last modification or
                 None when file does not exist
        :rtype: datetime|None
345854
def _get_last_cachefile_modification(self):
        

        try:
            mtime = os.path.getmtime(self._tld_list_path)
        except OSError:
            return None

        return datetime.fromtimestamp(mtime)
141396
def browser_cache(seconds):
    
    import web
    def wrap(f):
        def wrapped_f(*args):
            last_time_str = web.ctx.env.get('HTTP_IF_MODIFIED_SINCE', '')
            last_time = web.net.parsehttpdate(last_time_str)
            now = datetime.datetime.now()
            if last_time and\
                    last_time + datetime.timedelta(seconds = seconds) > now:
                web.notmodified()
            else:
                web.lastmodified(now)
                web.header('Cache-Control', 'max-age='+str(seconds))
            yield f(*args)
        return wrapped_f
    return wrap
80853
def modification_time(path)
      is_uri = URI.parse(path)
      if !is_uri.host.nil?
        return web_modification_time is_uri
      end
      File.new(path).mtime
    end
761002
def lastmod(self, tag):
        """"""
        lastitems = EntryModel.objects.published().order_by('-modification_date').filter(tags=tag).only('modification_date')
        return lastitems[0].modification_date
161213
def last_modified(self, last_modified):
        """"""
        self._indicator_data['lastModified'] = self._utils.format_datetime(
            last_modified, date_format='%Y-%m-%dT%H:%M:%SZ'
        )
112378
def get_last_modified_date(filename):
    
    if os.path.isfile(filename):
        t = os.path.getmtime(filename)
        return datetime.date.fromtimestamp(t).strftime('%d/%m/%Y')
    return None
1323573
def _restore_file_lmt(self):
        # type: (Descriptor) -> None
        
        if not self._restore_file_properties.lmt or self._ase.lmt is None:
            return
        # timestamp() func is not available in py27
        ts = time.mktime(self._ase.lmt.timetuple())
        os.utime(str(self.final_path), (ts, ts))
1020881
private Date getLastModifiedTime(URL url) {

		// see http://stackoverflow.com/questions/2416872/how-do-you-obtain-modified-date-from-a-remote-file-java
		Date date = null;
		try {
			String lastModified = url.openConnection().getHeaderField("Last-Modified");
			logger.debug("Last modified date of server file ({}) is {}",url.toString(),lastModified);


			if (lastModified!=null) {

				try {
					date = new SimpleDateFormat("E, d MMM yyyy HH:mm:ss Z", Locale.ENGLISH).parse(lastModified);
				} catch (ParseException e) {
					logger.warn("Could not parse last modified time from string '{}', no last modified time available for file {}",
							lastModified, url.toString());
					// this will return null
				}

			}
		} catch (IOException e) {
			logger.warn("Problems while retrieving last modified time for file {}", url.toString());
		}
		return date;

	}
899644
def last_modified options = {}
      changed_at = [Time.zone.at(::File.new("#{Rails.root}").mtime), created_at, updated_at, modified_at]
      
      if(options[:include_pages])
        changed_at << Humpyard::Page.select('updated_at').order('updated_at DESC').first.updated_at
      end
      
      (changed_at - [nil]).max.utc    
    end
1190977
def modified(self):
        '''
        
        '''
        try:
            dt = datetime.datetime.fromtimestamp(self.stats.st_mtime)
            return dt.strftime('%Y.%m.%d %H:%M:%S')
        except OSError:
            return None
1138382
def modified(self):
        
        value = self._proto.last_modified_time
        if value is not None and value != 0:
            # value will be in milliseconds.
            return google.cloud._helpers._datetime_from_microseconds(
                1000.0 * float(value)
            )
1277485
public FileGetFromTaskHeaders withLastModified(DateTime lastModified) {
        if (lastModified == null) {
            this.lastModified = null;
        } else {
            this.lastModified = new DateTimeRfc1123(lastModified);
        }
        return this;
    }
354081
def get(url, last_modified=None):
    
    try:
        with closing(urllib2.urlopen(url)) as page:
            if last_modified is not None:
                last_mod = dateutil.parser.parse(dict(page.info())['last-modified'])
                if last_mod <= last_modified:
                    return ""
            return page.read()
    except urllib2.URLError:
        return ""
846383
def modification_time(self):
    """"""
    timestamps = self._gzip_file.modification_times
    if not timestamps:
      return None
    return dfdatetime_posix_time.PosixTime(timestamp=timestamps[0])
711344
private static long getCachedLastModified(ServletContext servletContext, HeaderAndPath hap) {
		// Get the cache
		@SuppressWarnings("unchecked")
		Map<HeaderAndPath,GetLastModifiedCacheValue> cache = (Map<HeaderAndPath,GetLastModifiedCacheValue>)servletContext.getAttribute(GET_LAST_MODIFIED_CACHE_ATTRIBUTE_NAME);
		if(cache == null) {
			// Create new cache
			cache = new HashMap<>();
			servletContext.setAttribute(GET_LAST_MODIFIED_CACHE_ATTRIBUTE_NAME, cache);
		}
		GetLastModifiedCacheValue cacheValue;
		synchronized(cache) {
			// Get the cache entry
			cacheValue = cache.get(hap);
			if(cacheValue==null) {
				cacheValue = new GetLastModifiedCacheValue();
				cache.put(hap, cacheValue);
			}
		}
		synchronized(cacheValue) {
			final long currentTime = System.currentTimeMillis();
			if(cacheValue.isValid(currentTime)) {
				return cacheValue.lastModified;
			} else {
				ServletContextCache servletContextCache = ServletContextCache.getCache(servletContext);
				long lastModified = 0;
				String realPath = servletContextCache.getRealPath(hap.path);
				if(realPath != null) {
					// Use File first
					lastModified = new File(realPath).lastModified();
				}
				if(lastModified == 0) {
					// Try URL
					try {
						URL resourceUrl = servletContextCache.getResource(hap.path);
						if(resourceUrl != null) {
							URLConnection conn = resourceUrl.openConnection();
							conn.setAllowUserInteraction(false);
							conn.setConnectTimeout(10);
							conn.setDoInput(false);
							conn.setDoOutput(false);
							conn.setReadTimeout(10);
							conn.setUseCaches(false);
							lastModified = conn.getLastModified();
						}
					} catch(IOException e) {
						// lastModified stays unmodified
					}
				}
				// Store in cache
				cacheValue.cacheTime = currentTime;
				cacheValue.lastModified = lastModified;
				return lastModified;
			}
		}
	}
292653
def cache_info(cache_dir, cache_key):
    
    filename = os.path.join(cache_dir, cache_key)
    return os.path.getmtime(filename) if os.path.exists(filename) else 0
179728
def last_update_time(self) -> float:
        """"""
        stdout = self.stdout_interceptor
        stderr = self.stderr_interceptor

        return max([
            self._last_update_time,
            stdout.last_write_time if stdout else 0,
            stderr.last_write_time if stderr else 0,
        ])