Convert from decimal to a string of the form HH:MM.

 @param [#to_f] hours number of hours in decimal
 @return [String] of the form "HH:MM"
324446
def as_hours hours
      minutes = hours.to_f * 60.0
      sprintf "%d:%02d", (minutes / 60).to_i, (minutes % 60).to_i
    end
979762
def format(options)
      options.map do |key, value|
        [{
          format: :f,
          size: :s,
          length: :hls_time,
        }[key] || key, value].map(&:to_s).join('=')
      end
    end
535885
def CopyToDateTimeString(self):
    
    if self._timestamp is None:
      return None

    number_of_days, hours, minutes, seconds = self._GetTimeValues(
        self._timestamp)

    year, month, day_of_month = self._GetDateValues(number_of_days, 1970, 1, 1)

    if self.fraction_of_second is None:
      return '{0:04d}-{1:02d}-{2:02d} {3:02d}:{4:02d}:{5:02d}'.format(
          year, month, day_of_month, hours, minutes, seconds)

    if pytsk3.TSK_VERSION_NUM >= 0x040200ff:
      return '{0:04d}-{1:02d}-{2:02d} {3:02d}:{4:02d}:{5:02d}.{6:09d}'.format(
          year, month, day_of_month, hours, minutes, seconds,
          self.fraction_of_second)

    return '{0:04d}-{1:02d}-{2:02d} {3:02d}:{4:02d}:{5:02d}.{6:07d}'.format(
        year, month, day_of_month, hours, minutes, seconds,
        self.fraction_of_second)
685107
def _tzstr(self, sep=":"):
        """"""
        off = self.utcoffset()
        if off is not None:
            if off.days < 0:
                sign = "-"
                off = -off
            else:
                sign = "+"
            hh, mm = divmod(off, timedelta(hours=1))
            assert not mm % timedelta(minutes=1), "whole minute"
            mm //= timedelta(minutes=1)
            assert 0 <= hh < 24
            off = "%s%02d%s%02d" % (sign, hh, sep, mm)
        return off
966409
def parse_hh_mm_ss(self):
        
        split_count = self.raw.count(":")

        if split_count == 2:  # hh:mm:ss
            return datetime.strptime(str(self.raw).strip(), "%H:%M:%S").time()
        elif split_count == 1:  # mm:ss
            return datetime.strptime(str(self.raw).strip(), "%M:%S").time()

        return datetime.strptime(str(self.raw).strip(), "%S").time()
1116778
def time_to_hash(keys_case)
			raise Exception.new("Invalid time value: nil") if self.time.nil?
			
			# Custom date range
			if time.is_a?(Hash)
				return {
					get_attribute_key("custom_date_range_end", keys_case) => {
						get_attribute_key("day", keys_case) => self.time[:custom_date_range_end][:day],
						get_attribute_key("month", keys_case) => self.time[:custom_date_range_end][:month],
						get_attribute_key("year", keys_case) => self.time[:custom_date_range_end][:year],
						
					},
					get_attribute_key("custom_date_range_start", keys_case) => {
						get_attribute_key("day", keys_case) => self.time[:custom_date_range_start][:day],
						get_attribute_key("month", keys_case) => self.time[:custom_date_range_start][:month],
						get_attribute_key("year", keys_case) => self.time[:custom_date_range_start][:year],
					}
				}
			# Time periods
			else
				return TIME_PERIODS[time.to_s]
			end
		end
1264322
public static String timeToString(long time) {
        int[] fields = timeToFields(time, null);
        int millis = fields[5];
        int hour = millis / MILLIS_PER_HOUR;
        millis = millis % MILLIS_PER_HOUR;
        int min = millis / MILLIS_PER_MINUTE;
        millis = millis % MILLIS_PER_MINUTE;
        int sec = millis / MILLIS_PER_SECOND;
        millis = millis % MILLIS_PER_SECOND;

        return String.format((Locale)null, "%04d-%02d-%02dT%02d:%02d:%02d.%03dZ",
                fields[0], fields[1] + 1, fields[2], hour, min, sec, millis);
    }
369491
function secondsToTime(secs) {
  var days = Math.floor(secs / (60 * 60 * 24))
    , divisor_for_hours = secs % (60 * 60 * 24)
    , hours = Math.floor(divisor_for_hours / (60 * 60))
    , divisor_for_minutes = secs % (60 * 60)
    , minutes = Math.floor(divisor_for_minutes / 60)
    , divisor_for_seconds = divisor_for_minutes % 60
    , seconds = Math.ceil(divisor_for_seconds);
  return {"d": days, "h": hours, "m": minutes, "s": seconds};
}
1161938
def simple_time(value):
    
    if isinstance(value, timedelta):
        return ':'.join(str(value).split(':')[:2])
    return datetime_to_string(value, '%H:%M')
865571
def hms_to_seconds(time_string):
    
    s = time_string.split(':')
    hours = int(s[0])
    minutes = int(s[1])
    secs = float(s[2])
    return hours * 3600 + minutes * 60 + secs
545102
def convert_time_to_hour_minute(hour, minute, convention):
    
    if hour is None:
        hour = 0
    if minute is None:
        minute = 0
    if convention is None:
        convention = 'am'

    hour = int(hour)
    minute = int(minute)

    if convention.lower() == 'pm':
        hour += 12

    return {'hours': hour, 'minutes': minute}
647919
function format(ms) {
  if (ms == d) return Math.round(ms / d) + ' day';
  if (ms > d) return Math.round(ms / d) + ' days';
  if (ms == h) return Math.round(ms / h) + ' hour';
  if (ms > h) return Math.round(ms / h) + ' hours';
  if (ms == m) return Math.round(ms / m) + ' minute';
  if (ms > m) return Math.round(ms / m) + ' minutes';
  if (ms == s) return Math.round(ms / s) + ' second';
  if (ms > s) return Math.round(ms / s) + ' seconds';
  return ms + ' ms';
}
770502
def duration_to_string(duration):
    

    m, s = divmod(duration, 60)
    h, m = divmod(m, 60)
    return "%d:%02d:%02d" % (h, m, s)
1002239
def to_long_time_string(self) -> str:
        
        hour = self.time.hour
        minute = self.time.minute
        second = self.time.second
        return f"{hour:02}:{minute:02}:{second:02}"
766216
def time_str_to_minutes(time_str):
    
    time_arr = time_str.split(":")
    hours = int(time_arr[0])
    minutes = int(time_arr[1])
    return hours * 60 + minutes
272197
def hour_of_day(*hours)
      hours.flatten.each do |hour|
        unless hour.is_a?(Integer)
          raise ArgumentError, "expecting Integer value for hour, got #{hour.inspect}"
        end

        verify_alignment(hour, :hour, :hour_of_day) { |error| raise error }

        validations_for(:hour_of_day) << Validation.new(hour)
      end
      clobber_base_validations(:hour)
      self
    end
703665
def to_s(format=nil)
      if format && to_time.public_method(:to_s).arity != 0
        t0, t1 = start_time.to_s(format), end_time.to_s(format)
      else
        t0, t1 = start_time.to_s, end_time.to_s
      end
      duration > 0 ? "#{t0} - #{t1}" : t0
    end