Returns the localized time in string format
435639
def ulocalized_time(self, time, context, request):
        
        value = ut(time, long_format=self.show_time, time_only=False,
                   context=context, request=request)
        return value or ""
1261453
def get_system_time():
    '''
    
    '''
    now = win32api.GetLocalTime()
    meridian = 'AM'
    hours = int(now[4])
    if hours == 12:
        meridian = 'PM'
    elif hours == 0:
        hours = 12
    elif hours > 12:
        hours = hours - 12
        meridian = 'PM'
    return '{0:02d}:{1:02d}:{2:02d} {3}'.format(hours, now[5], now[6], meridian)
1372602
def get_local_time(index):
    
    dt = index.to_pydatetime()
    dt = dt.replace(tzinfo=pytz.utc)
    return dt.astimezone(tzlocal()).time()
169140
def ToDatetime(self):
    """"""
    return datetime.utcfromtimestamp(
        self.seconds + self.nanos / float(_NANOS_PER_SECOND))
673097
private String zGetStandardTextFieldTimeString(LocalTime time) {
        String standardTimeString = "";
        if (time == null) {
            return standardTimeString;
        }
        standardTimeString = time.format(settings.getFormatForDisplayTime());
        return standardTimeString;
    }
671265
def log_date_time_string(self):
        """"""
        now = time.time()
        year, month, day, hh, mm, ss, x, y, z = time.localtime(now)
        s = "%02d/%3s/%04d %02d:%02d:%02d" % (
                day, self.monthname[month], year, hh, mm, ss)
        return s
114728
def get_time_from_str(when):
    
    zero_oclock_today = datetime.now(tzlocal()).replace(
            hour=0, minute=0, second=0, microsecond=0)

    try:
        event_time = dateutil_parse(when, default=zero_oclock_today)
    except ValueError:
        struct, result = fuzzy_date_parse(when)
        if not result:
            raise ValueError('Date and time is invalid: %s' % (when))
        event_time = datetime.fromtimestamp(time.mktime(struct), tzlocal())

    return event_time
997864
def getCurrentStrDatetime():
    
    # Generating current time
    i = datetime.datetime.now()
    strTime = "%s-%s-%s_%sh%sm" % (i.year, i.month, i.day, i.hour, i.minute)
    return strTime
876415
function getLocaleDayNames(locale, formStyle, width) {
    var /** @type {?} */ data = findLocaleData(locale);
    var /** @type {?} */ daysData = /** @type {?} */ ([data[3 /* DaysFormat */], data[4 /* DaysStandalone */]]);
    var /** @type {?} */ days = getLastDefinedValue(daysData, formStyle);
    return getLastDefinedValue(days, width);
}
544851
function formatTime(time) {
  let date = new Date(time);

  return (date.getFullYear() + '-' +
    zeroPad(date.getMonth() + 1) + '-' +
    zeroPad(date.getDate()) + ' ' +
    zeroPad(date.getHours()) + ':' +
    zeroPad(date.getMinutes()) + ':' +
    zeroPad(date.getSeconds()));

  function zeroPad(num) {
    return ('0' + num).slice(-2)
  }
}
1119801
public String getDuration(Locale locale) {
        long durationL = (long)durationSeconds;

        // Output as Hours / Minutes / Seconds / Parts
        long hours = TimeUnit.SECONDS.toHours(durationL);
        long mins = TimeUnit.SECONDS.toMinutes(durationL) - (hours*60);
        double secs = durationSeconds - (((hours*60)+mins)*60);

        return String.format(locale, "%02d:%02d:%05.2f", hours, mins, secs);
    }
406645
def StringToUTCTime(time_string):
    
    szTime = c_char_p(time_string.encode('utf-8'))
    res = dna_dll.StringToUTCTime(szTime)
    return res
429600
def strftime_string(C, msformat):
        ""
        s = msformat
        s = re.sub(r"%", "%%", s)                   # percent sign
        s = re.sub(r"(?<!%)\b(y(?:yyy)?)\b", "%Y", s)   # 4-digit year
        s = re.sub(r"(?<!%)\b(yy)\b", "%y", s)     # 2-digit year
        s = re.sub(r"(?<!%)\b(MMMM)\b", "%B", s)   # full month
        s = re.sub(r"(?<!%)\b(MMM)\b", "%b", s)    # abbrev. month
        s = re.sub(r"(?<!%)\b(MM)\b", "%m", s)     # 2-digit month
        s = re.sub(r"(?<!%)\b(dd?)\b", "%d", s)    # day
        s = re.sub(r"(?<!%)\b(hh?)\b", "%I", s)    # 12-hr hour
        s = re.sub(r"(?<!%)\b(HH?)\b", "%H", s)    # 24-hr hour
        s = re.sub(r"(?<!%)\b(mm?)\b", "%M", s)    # minute
        s = re.sub(r"(?<!%)\b(ss?)\b", "%S", s)    # second
        s = re.sub(r"(?<!%)\b(am/pm)\b", "%p", s)  # 2-digit year
        return s
613833
def get_timezone() -> Tuple[datetime.tzinfo, str]:
    """"""
    dt = get_datetime_now().astimezone()
    tzstr = dt.strftime("%z")
    tzstr = tzstr[:-2] + ":" + tzstr[-2:]
    return dt.tzinfo, tzstr
1160225
public static function timezoneString() {
		// if site timezone string exists, return it
		if ( $timezone = get_option('timezone_string') ) {
			return $timezone;
		}
		// get UTC offset, if it isn't set then return UTC
		if ( ! $utc_offset = get_option('gmt_offset', 0) ) {
			return 'UTC';
		}
		// adjust UTC offset from hours to seconds
		$utc_offset *= 3600;
		// attempt to guess the timezone string from the UTC offset
		if ( $timezone = timezone_name_from_abbr('', $utc_offset, 0 ) ) {
			return $timezone;
		}
		// last try, guess timezone string manually
		$is_dst = date('I');
		foreach ( timezone_abbreviations_list() as $abbr ) {
			foreach ( $abbr as $city ) {
				if ( $city['dst'] == $is_dst && $city['offset'] == $utc_offset ) {
					return $city['timezone_id'];
				}
			}
		}
		
		// fallback to UTC
		return 'UTC';
	}
228425
def timestamp(value):
    
    value = value if timezone.is_naive(value) else timezone.localtime(value)
    return value.strftime(settings.DATE_FORMAT)
1235259
def isoformat(self):
        
        text = [self.strftime('%Y-%m-%dT%H:%M:%S'), ]
        if self.tzinfo:
            text.append(self.tzinfo.as_timezone())
        else:
            text.append('+00:00')
        return ''.join(text)