Returns a uniform timestamp with parameter values for file identification
334467
def timestamp(num_params, p_levels, k_choices, N):
    
    string = "_v%s_l%s_gs%s_k%s_N%s_%s.txt" % (num_params,
                                               p_levels,
                                               k_choices,
                                               N,
                                               dt.strftime(dt.now(),
                                                           "%d%m%y%H%M%S"))
    return string
490307
function getAddMtime(file, done) {
    fs.stat(path.join(source, file), addMtime);


    /**
     * Adds `stats.mtime` of `file` to its metadata.
     *
     * @param {Error} err
     * @param {fs.Stats} stats
     * @api private
     */

    function addMtime(err, stats) {
      if (err) {
        // Skip elements of `files` that don't point to existing files.
        // This can happen if some other Metalsmith plugin does something
        // strange with `files`.
        if (err.code === 'ENOENT') {
          debug('file %s not found', file);
          return done();
        }
        return done(err);
      }

      debug('mtime of file %s is %s', file, stats.mtime);
      files[file].mtime = stats.mtime;
      done();
    }
  }
190864
def _get_cibfile_tmp(cibname):
    '''
    
    '''
    cibfile_tmp = '{0}.tmp'.format(_get_cibfile(cibname))
    log.trace('cibfile_tmp: %s', cibfile_tmp)
    return cibfile_tmp
903654
def time2fname(tstamp, full=False):
    """"""
    result = tstamp.strftime(FILENAME_FORMAT)
    result = result if not full else join(time2dir(tstamp), result)
    return result
1083027
function fidjTimestampFormat(timestamp) {
    var date = new Date(timestamp);
    return fidjPadNumber(date.getFullYear(), 4) + '-' +
        fidjPadNumber(date.getMonth() + 1, 2) + '-' +
        fidjPadNumber(date.getDate(), 2) + ' ' +
        fidjPadNumber(date.getHours(), 2) + ':' +
        fidjPadNumber(date.getMinutes(), 2) + ':' +
        fidjPadNumber(date.getSeconds(), 2);
}
25382
def new_timestamped_uid(bits=32):
  
  return "%s-%s" % (re.sub('[^\w.]', '', datetime.now().isoformat()).replace(".", "Z-"), new_uid(bits))
1134665
def init_file(self, filename, time_units="seconds since 1970-01-01T00:00"):
        
        if os.access(filename, os.R_OK):
            out_data = Dataset(filename, "r+")
        else:
            out_data = Dataset(filename, "w")
            if len(self.data.shape) == 2:
                for d, dim in enumerate(["y", "x"]):
                    out_data.createDimension(dim, self.data.shape[d])
            else:
                for d, dim in enumerate(["y", "x"]):
                    out_data.createDimension(dim, self.data.shape[d+1])
            out_data.createDimension("time", len(self.times))
            time_var = out_data.createVariable("time", "i8", ("time",))
            time_var[:] = date2num(self.times.to_pydatetime(), time_units)
            time_var.units = time_units
            out_data.Conventions = "CF-1.6"
        return out_data
481667
def get_timestamp(self, **kwargs):
        """"""
        timestamp = kwargs.get('timestamp')
        if not timestamp:
            now = datetime.datetime.utcnow()
            timestamp = now.strftime("%Y-%m-%dT%H:%M:%S") + ".%03d" % (now.microsecond / 1000) + "Z"

        return timestamp
519180
def per_file_type_data(self):
        
        ret = {}
        for cache_date in self.cache_dates:
            data = self._cache_get(cache_date)
            if len(data['by_file_type']) == 0:
                data['by_file_type'] = {'other': 0}
            ret[cache_date] = data['by_file_type']
        return ret
1153096
def pretty_timestamp(timestamp, date_format='%a-%m_%d_%y:%H:%M:%S'):
    """"""
    return time.strftime(date_format,
                         time.localtime(int(str(timestamp)[:10])))
283478
def last_modified_date(filename):
    """"""
    mtime = os.path.getmtime(filename)
    dt = datetime.datetime.utcfromtimestamp(mtime)
    return dt.replace(tzinfo=pytz.utc)
183331
private String getFormattedTimestamp(int offset) {
        SimpleDateFormat df = new SimpleDateFormat(
                "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
        df.setTimeZone(TimeZone.getTimeZone("UTC"));

        if (overriddenDate != null) {
            return df.format(overriddenDate);
        } else {
            return df.format(getSignatureDate(offset));
        }
    }
228375
def backup_name(self, timestamp=None):
        
        suffix = datetime2string(coalesce(timestamp, datetime.now()), "%Y%m%d_%H%M%S")
        return File.add_suffix(self._filename, suffix)
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
807697
def get_timestamp(dt=None):
    '''
    
    '''

    if dt is None: dt = datetime.datetime.utcnow()
    t = dt.utctimetuple()

    return calendar.timegm(t)
767561
def mtime(self, fpath=None):
        
        return dtformat(
            datetime.datetime.utcfromtimestamp(
                os.path.getmtime(fpath or self.fpath)))
349731
def mtime(filename, local = false)
      str = mdtm(filename)
      ary = str.scan(MDTM_REGEXP)[0].collect {|i| i.to_i}
      return local ? Time.local(*ary) : Time.gm(*ary)
    end