Returns string with relevant time information formatted properly
331305
def format_time(start, end):
    """"""
    try:
        cpu_usr = end[0] - start[0]
        cpu_sys = end[1] - start[1]

    except TypeError:
        # `clock()[1] == None` so subtraction results in a TypeError
        return 'Time elapsed: {}'.format(human_time(cpu_usr))

    else:
        times = (human_time(x) for x in (cpu_usr, cpu_sys, cpu_usr + cpu_sys))
        return 'Time elapsed: user: {}, sys: {}, total: {}'.format(*times)
1180972
def to_datetime_string(self) -> str:
        
        date_display = self.to_iso_date_string()
        time_display = self.to_long_time_string()
        return f"{date_display} {time_display}"
355925
def datetime(self):
        
        if self._time == '':
            return datetime.strptime(self._date, '%b %d, %Y')
        date_string = '%s %s' % (self._date, self._time)
        return datetime.strptime(date_string, '%b %d, %Y %I:%M %p')
457350
def to_iso_time_string(self) -> str:
        
        short_time = self.to_short_time_string()
        second = self.time.second
        return f"{short_time}:{second:02}"
1365876
function getTimeString (now) {
  var year = "" + now.getFullYear();
  var month = "" + (now.getMonth() + 1); if (month.length == 1) { month = "0" + month }
  var day = "" + now.getDate(); if (day.length == 1) { day = "0" + day }
  var hour = "" + now.getHours(); if (hour.length == 1) { hour = "0" + hour }
  var minute = "" + now.getMinutes(); if (minute.length == 1) { minute = "0" + minute }
  var second = "" + now.getSeconds(); if (second.length == 1) { second = "0" + second }
  var ms = "" + now.getMilliseconds(); while (ms.length < 3) { ms = "0"+ms }
  return year + "-" + month + "-" + day + " " + hour + ":" + minute + ":" + second + "." + ms;
}
297615
def stringToDateTime(s, tzinfo=None):
    """"""
    try:
        year = int(s[0:4])
        month = int(s[4:6])
        day = int(s[6:8])
        hour = int(s[9:11])
        minute = int(s[11:13])
        second = int(s[13:15])
        if len(s) > 15:
            if s[15] == 'Z':
                tzinfo = utc
    except:
        raise ParseError("'%s' is not a valid DATE-TIME" % s)
    year = year and year or 2000
    return datetime.datetime(year, month, day, hour, minute, second, 0, tzinfo)
779310
def pad_timestamp(string, pad_str=PAD_6_UP):
    

    str_len = len(string)
    pad_len = len(pad_str)

    if str_len < pad_len:
        string = string + pad_str[str_len:]

    return string
209629
def FormatSOAPDateTime(value):
  
  value_date = value['date']
  return '%s-%s-%s %s:%s:%s (%s)' % (
      value_date['year'], value_date['month'], value_date['day'],
      value['hour'], value['minute'], value['second'], value['timeZoneId'])
299169
function getCurrentTimeString() {
    var today = new Date();
    var hh = today.getHours();
    var mm = today.getMinutes(); //January is 0
    var ss = today.getSeconds();
    var ms = today.getMilliseconds();

    if (hh < 10) {
        hh = '0' + hh;
    }

    if (mm < 10) {
        mm = '0' + mm;
    }

    if (ss < 10) {
        ss = '0' + ss;
    }

    if (ms < 10) {
        ms = '0' + ms;
    }

    return hh + ":" + mm + ":" + ss + ":" + ms;
}
1248713
def timeFormat(time_from, time_to=None, prefix="", infix=None):
    
    retval = ""
    if time_from != "" and time_from is not None:
        retval += prefix
        retval += dateformat.time_format(time_from, "fA").lower()
    if time_to != "" and time_to is not None:
        to = format(dateformat.time_format(time_to, "fA").lower())
        if infix is not None:
            retval = "{} {} {}".format(retval, infix, to)
        else:
            retval = _("{fromTime} to {toTime}").format(fromTime=retval,
                                                        toTime=to)
    return retval.strip()
296817
def check_time_param(t):
    """"""

    if type(t) is str:
        if not ISO.match(t):
            raise ValueError('Date string "%s" does not match ISO8601 format' %
                             (t))
        return t
    else:
        return t.isoformat()
1296863
function getLetterTime(timeString) {
  var totalSeconds = 0;
  var timeValues = {
    's': 1,
    'm': 1 * 60,
    'h': 1 * 60 * 60,
    'd': 1 * 60 * 60 * 24,
    'w': 1 * 60 * 60 * 24 * 7,
  };
  var timePairs;

  //expand to "1 h 30 m 20 s" and split
  timeString = timeString.replace(/([smhdw])/g, ' $1 ').trim();
  timePairs = timeString.split(' ');

  for (var i = 0; i < timePairs.length; i += 2) {
    totalSeconds += parseInt(timePairs[i], 10) *
      timeValues[timePairs[i + 1] || 's'];
  }
  return totalSeconds;
}
1149233
def _get_date_time_format(dt_string):
    '''
    
    '''
    valid_formats = [
        '%I:%M:%S %p',
        '%I:%M %p',
        '%H:%M:%S',
        '%H:%M',
        '%Y-%m-%d',
        '%m-%d-%y',
        '%m-%d-%Y',
        '%m/%d/%y',
        '%m/%d/%Y',
        '%Y/%m/%d'
    ]
    for dt_format in valid_formats:
        try:
            datetime.strptime(dt_string, dt_format)
            return dt_format
        except ValueError:
            continue
    return False
642806
def timeInfo(self):
        """"""
        time_info = self._json_struct.get('timeInfo', {})
        if not time_info:
            return None
        time_info = time_info.copy()
        if 'timeExtent' in time_info:
            time_info['timeExtent'] = utils.timetopythonvalue(
                                                    time_info['timeExtent'])
        return time_info
885857
def current_time(self) -> datetime:
        """"""
        _date = datetime.strptime(self.obj.SBRes.SBReq.StartT.get("date"), "%Y%m%d")
        _time = datetime.strptime(self.obj.SBRes.SBReq.StartT.get("time"), "%H:%M")
        return datetime.combine(_date.date(), _time.time())
1023748
def str_to_time(self):
        

        return datetime(*list(map(int, re.split(r'-|:|T', self.time))))
487975
def _strptime(self, time_str):
        """"""
        if time_str:
            # Parse UTC string into naive datetime, then add timezone
            dt = datetime.strptime(time_str, __timeformat__)
            return dt.replace(tzinfo=UTC())
        return None