return output of 822-date command
332752
def get_date_822():
    """"""
    cmd = '/bin/date'
    if not os.path.exists(cmd):
        raise ValueError('%s command does not exist.'%cmd)
    args = [cmd,'-R']
    result = get_cmd_stdout(args).strip()
    result = normstr(result)
    return result
137488
def QA_util_date_stamp(date):
    
    datestr = str(date)[0:10]
    date = time.mktime(time.strptime(datestr, '%Y-%m-%d'))
    return date
242686
def command2str(num):
    
    for attr in SLOT.__dict__.keys():
        if not attr.startswith('_') and attr == attr.upper():
            if getattr(SLOT, attr) == num:
                return 'SLOT_%s' % attr

    return "0x%02x" % (num)
97624
def fnFromDate(self, date):
        """"""
        fn = time.strftime('comics-%Y%m%d', date)
        fn = os.path.join(self.basepath, 'html', fn + ".html")
        fn = os.path.abspath(fn)
        return fn
804995
def QA_util_date_int2str(int_date):
    
    date = str(int_date)
    if len(date) == 8:
        return str(date[0:4] + '-' + date[4:6] + '-' + date[6:8])
    elif len(date) == 10:
        return date
927778
def __printCommandSyntax(self, command):
        
        commandHelp = self.completion[command]
        if commandHelp != None and len(commandHelp) > 2:
            commandValues = commandHelp[2]
            #commandDefault = commandHelp[3]
            displayHelp = [self._color(self.COLOR_WHITE, command)]
            if commandValues != None:
                valuesIsEnum = len(commandHelp) >= 6
                if '+' in command or command.upper() in ['ATS0']:
                    displayHelp.append(self._color(self.COLOR_WHITE, '='))
                displayHelp.append(('|' if valuesIsEnum else ',').join([value[0] for value in commandValues]))
            sys.stdout.write('\r Syntax: {0}\n'.format(self._color(self.COLOR_WHITE, ''.join(displayHelp))))
            sys.stdout.flush()
            self._refreshInputPrompt(len(self.inputBuffer))
1084006
def _x_format(self):
        """"""

        def date_to_str(x):
            t = seconds_to_time(x)
            return self.x_value_formatter(t)

        return date_to_str
43125
def dosdate(dosdate, dostime):
    
    try:
        t  = ord(dosdate[1]) << 8
        t |= ord(dosdate[0])
        day   = t & 0b0000000000011111
        month = (t & 0b0000000111100000) >> 5
        year  = (t & 0b1111111000000000) >> 9
        year += 1980

        t  = ord(dostime[1]) << 8
        t |= ord(dostime[0])
        sec     = t & 0b0000000000011111
        sec    *= 2
        minute  = (t & 0b0000011111100000) >> 5
        hour    = (t & 0b1111100000000000) >> 11

        return datetime(year, month, day, hour, minute, sec)
    except:
        return datetime.min
317429
def dateheure(objet):
        
        if objet:
            return "{}/{}/{} à {:02}:{:02}".format(objet.day, objet.month, objet.year, objet.hour, objet.minute)
        return ""
594912
private static String guessDumpDate(String fileName) {
		Pattern p = Pattern.compile("([0-9]{8})");
		Matcher m = p.matcher(fileName);

		if (m.find()) {
			return m.group(1);
		} else {
			logger.info("Could not guess date of the dump file \"" + fileName
					+ "\". Defaulting to YYYYMMDD.");
			return "YYYYMMDD";
		}
	}
1059728
def render_date(date, tz=pytz.utc, fmt=_FULL_OUTPUT_FORMAT):
    """"""
    local = date.astimezone(tz)
    ts = __date_to_millisecond_ts(date)
    return fmt.format(
            ts=ts,
            utc=date.strftime(_DATE_FORMAT),
            millis=ts % 1000,
            utc_tz=date.strftime(_TZ_FORMAT),
            local=local.strftime(_DATE_FORMAT),
            local_tz=local.strftime(_TZ_FORMAT),
            delta=render_delta_from_now(date))
422864
def dateDict(date, prefix = ""):
    """"""
    res = {}

    res[prefix+"a"] = date.strftime("%a")
    res[prefix+"A"] = date.strftime("%A")
    res[prefix+"b"] = date.strftime("%b")
    res[prefix+"B"] = date.strftime("%B")
    res[prefix+"c"] = date.strftime("%c")
    res[prefix+"d"] = date.strftime("%d")
    res[prefix+"H"] = date.strftime("%H")
    res[prefix+"I"] = date.strftime("%I")
    res[prefix+"j"] = date.strftime("%j")
    res[prefix+"m"] = date.strftime("%m")
    res[prefix+"M"] = date.strftime("%M")
    res[prefix+"p"] = date.strftime("%p")
    res[prefix+"S"] = date.strftime("%S")
    res[prefix+"U"] = date.strftime("%U")
    res[prefix+"w"] = date.strftime("%w")
    res[prefix+"W"] = date.strftime("%W")
    res[prefix+"x"] = date.strftime("%x")
    res[prefix+"X"] = date.strftime("%X")
    res[prefix+"y"] = date.strftime("%y")
    res[prefix+"Y"] = date.strftime("%Y")
    res[prefix+"Z"] = date.strftime("%Z")

    for i, value in res.items():
        res[i] = locale_to_utf8(value)

    return res
1338786
def output_date(datetime, output_date: :abbr, output_date_length: :month,
			**opts)
			lang=opts[:lang]||:en
			year,month,day,time=split_date(datetime)
			month=nil if output_date_length==:year
			day=nil if output_date_length==:month
			time=nil if output_date_length==:day
			return Formatter.localize({en: 'Present', fr: 'Présent'},**opts) if datetime==:now
			r=year
			case output_date
			when :num
				month.nil? ? (return r) : r+="-"+month
				day.nil? ? (return r) : r+="-"+day
				time.nil? ? (return r) : r+="T"+time
			when :abbr,:string
				return r if month.nil?
				month_name=Months_names[lang][month.to_i]
				month_name=abbr_month(month_name) if output_date==:abbr
				r=month_name+" "+r
				return r if day.nil?
				r=day+" "+r
				return r if time.nil?
				r+=" "+time
			end
			r
		end
1219604
def _get_version_output(self):
        
        if not self.executable:
            return ''
        command = [self.executable, '--version']
        out, _, _ = self._check(self.conn, command)
        try:
            return out.decode('utf-8').split()[2]
        except IndexError:
            return ''
474848
def AmericanDateToEpoch(self, date_str):
    """"""
    try:
      epoch = time.strptime(date_str, "%m/%d/%Y")
      return int(calendar.timegm(epoch)) * 1000000
    except ValueError:
      return 0
85403
static function UnixDate($v)
	{
	global $ADODB_sybase_mths;

		//Dec 30 2000 12:00AM
		if (!preg_match( "/([A-Za-z]{3})[-/\. ]+([0-9]{1,2})[-/\. ]+([0-9]{4})/"
			,$v, $rr)) return parent::UnixDate($v);

		if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0;

		$themth = substr(strtoupper($rr[1]),0,3);
		$themth = $ADODB_sybase_mths[$themth];
		if ($themth <= 0) return false;
		// h-m-s-MM-DD-YY
		return  adodb_mktime(0,0,0,$themth,$rr[2],$rr[3]);
	}
232155
def current_command_version
      output = command('version', [], false)
      version = output[/\d+\.\d+(\.\d+)+/]
      version.split('.').collect {|i| i.to_i}
    end