Get locale time string for time portion of job runtime. Specially handle number of days running as a prefix.
358501
function getElapsedTimeString(start_timestamp_ms, updated_timestamp_ms) {
  var updatedDiff = updated_timestamp_ms - start_timestamp_ms;
  var updatedDays = Math.floor(updatedDiff / 86400000.0);
  updatedDiff -= (updatedDays * 86400000.0);
  var updatedHours = Math.floor(updatedDiff / 3600000.0);
  updatedDiff -= (updatedHours * 3600000.0);
  var updatedMinutes = Math.floor(updatedDiff / 60000.0);
  updatedDiff -= (updatedMinutes * 60000.0);
  var updatedSeconds = Math.floor(updatedDiff / 1000.0);

  var updatedString = '';
  if (updatedDays == 1) {
    updatedString = '1 day, ';
  } else if (updatedDays > 1) {
    updatedString = '' + updatedDays + ' days, ';
  }
  updatedString +=
      leftPadNumber(updatedHours, 2, '0') + ':' +
      leftPadNumber(updatedMinutes, 2, '0') + ':' +
      leftPadNumber(updatedSeconds, 2, '0');

  return updatedString;
}
670274
private String getTimeString(Date value)
   {
      Calendar cal = DateHelper.popCalendar(value);
      int hours = cal.get(Calendar.HOUR_OF_DAY);
      int minutes = cal.get(Calendar.MINUTE);
      DateHelper.pushCalendar(cal);
      
      StringBuilder sb = new StringBuilder(4);
      sb.append(m_twoDigitFormat.format(hours));
      sb.append(m_twoDigitFormat.format(minutes));

      return (sb.toString());
   }
255111
private String getScheduling(TaskType value)
   {
      String result = "fixed-work";
      if (value != null && value == TaskType.FIXED_DURATION)
      {
         result = "fixed-duration";
      }
      return (result);
   }
1069443
def c_time_locale():
    """"""
    old_time_locale = locale.getlocale(locale.LC_TIME)
    locale.setlocale(locale.LC_TIME, 'C')
    yield
    locale.setlocale(locale.LC_TIME, old_time_locale)
360907
static DayPeriod of(
        Locale locale,
        String calendarType
    ) {

        String lang = locale.getLanguage(); // NPE-check

        if (lang.equals("nn")) {
            locale = new Locale("nb"); // CLDR 29 contains no data for language nn
        }

        Map<String, String> resourceMap = loadTextForms(locale, calendarType);
        SortedMap<PlainTime, String> codeMap = Collections.emptySortedMap();

        for (String key : resourceMap.keySet()) {
            if (accept(key)) {
                int hour = Integer.parseInt(key.substring(1, 3));
                int minute = Integer.parseInt(key.substring(3, 5));
                PlainTime time = PlainTime.midnightAtStartOfDay();
                if (hour == 24) {
                    if (minute != 0) {
                        throw new IllegalStateException("Invalid time key: " + key);
                    }
                } else if ((hour >= 0) && (hour < 24) && (minute >= 0) && (minute < 60)) {
                    time = time.plus(hour * 60 + minute, ClockUnit.MINUTES);
                } else {
                    throw new IllegalStateException("Invalid time key: " + key);
                }
                if (codeMap.isEmpty()) {
                    codeMap = new TreeMap<>();
                }
                codeMap.put(time, resourceMap.get(key));
            }
        }

        if (codeMap.isEmpty() || lang.isEmpty()) {
            return FALLBACK;
        }

        Iterator<PlainTime> iter = codeMap.keySet().iterator();
        String oldCode = "";

        while (iter.hasNext()) {
            PlainTime time = iter.next();
            String code = codeMap.get(time);
            if (code.equals(oldCode)) {
                iter.remove(); // lex colombia
            } else {
                oldCode = code;
            }
        }

        return new DayPeriod(locale, calendarType, codeMap);

    }
1272264
private static String getDateTimeString(long time) {
        int[] fields = Grego.timeToFields(time, null);
        StringBuilder sb = new StringBuilder(15);
        sb.append(numToString(fields[0], 4));
        sb.append(numToString(fields[1] + 1, 2));
        sb.append(numToString(fields[2], 2));
        sb.append('T');

        int t = fields[5];
        int hour = t / Grego.MILLIS_PER_HOUR;
        t %= Grego.MILLIS_PER_HOUR;
        int min = t / Grego.MILLIS_PER_MINUTE;
        t %= Grego.MILLIS_PER_MINUTE;
        int sec = t / Grego.MILLIS_PER_SECOND;
        
        sb.append(numToString(hour, 2));
        sb.append(numToString(min, 2));
        sb.append(numToString(sec, 2));
        return sb.toString();
    }
67813
def _evalTimeStr(self, datetimeString, sourceTime):
        
        s = datetimeString.strip()
        sourceTime = self._evalDT(datetimeString, sourceTime)

        if s in self.ptc.re_values['now']:
            self.currentContext.updateAccuracy(pdtContext.ACU_NOW)
        else:
            # Given string is a natural language time string like
            # lunch, midnight, etc
            sTime = self.ptc.getSource(s, sourceTime)
            if sTime:
                sourceTime = sTime
            self.currentContext.updateAccuracy(pdtContext.ACU_HALFDAY)

        return sourceTime
918314
def _CopyToDateTimeString(self):
    
    if self._timestamp is None:
      return None

    timestamp, nanoseconds = divmod(
        self._timestamp, definitions.NANOSECONDS_PER_SECOND)
    number_of_days, hours, minutes, seconds = self._GetTimeValues(timestamp)

    year, month, day_of_month = self._GetDateValuesWithEpoch(
        number_of_days, self._EPOCH)

    return '{0:04d}-{1:02d}-{2:02d} {3:02d}:{4:02d}:{5:02d}.{6:09d}'.format(
        year, month, day_of_month, hours, minutes, seconds, nanoseconds)
115836
def _get_timezone(self, root):
        """"""
        tz_str = root.xpath('//div[@class="smallfont" and @align="center"]')[0].text
        hours = int(self._tz_re.search(tz_str).group(1))
        return tzoffset(tz_str, hours * 60)
982107
public static TimeZoneNames getInstance(ULocale locale) {
        String key = locale.getBaseName();
        return TZNAMES_CACHE.getInstance(key, locale);
    }
1070072
function getExpiryTime(task){
    if (!isNaN(task.after)) {
      return "'now', '+"+task.after+" seconds'";
    } else if (!task.at) {
      task.at = new Date();
    }
    return "'"+task.at.toISOString()+"'";
  }
730833
@Expose
    public static String times(final Number num, final Locale locale)
    {
        return withinLocale(new Callable<String>()
        {
            @Override
            public String call() throws Exception
            {
                return times(num);
            }
        }, locale);
    }
294035
def get_time():
    
    import datetime
    time=make_pathable_string('%s' % datetime.datetime.now())
    return time.replace('-','_').replace(':','_').replace('.','_')
678132
def time_str (time_t, slug = False):
  '''
  '''
  return datetime.fromtimestamp (int (time_t)).strftime (
    DEFAULT_SLUGFORMAT if slug else DEFAULT_TIMEFORMAT)
382151
public static String formatRuntime(long runtime) {

        long seconds = (runtime / SECONDS) % 60;
        long minutes = (runtime / MINUTES) % 60;
        long hours = (runtime / HOURS) % 24;
        long days = runtime / DAYS;
        StringBuffer strBuf = new StringBuffer();

        if (days > 0) {
            if (days < 10) {
                strBuf.append('0');
            }
            strBuf.append(days);
            strBuf.append(':');
        }

        if (hours < 10) {
            strBuf.append('0');
        }
        strBuf.append(hours);
        strBuf.append(':');

        if (minutes < 10) {
            strBuf.append('0');
        }
        strBuf.append(minutes);
        strBuf.append(':');

        if (seconds < 10) {
            strBuf.append('0');
        }
        strBuf.append(seconds);

        return strBuf.toString();
    }
534630
public String printShortLocaleTime()
  {
    _date.setTime(_localTimeOfEpoch);

    if (_shortTimeFormat == null)
      _shortTimeFormat = DateFormat.getTimeInstance(DateFormat.SHORT);

    return _shortTimeFormat.format(_date);
  }
948532
def timestamp_localize(value):
        
        if isinstance(value, datetime.datetime):
            if not value.tzinfo:
                value = pytz.UTC.localize(value)
            else:
                value = value.astimezone(pytz.UTC)
            # Assumes utc (and add the microsecond part)
            value = calendar.timegm(value.timetuple()) + \
                value.microsecond / 1e6
        return value