MCPcopy Index your code
hub / github.com/python/cpython / _strptime_datetime_time

Function _strptime_datetime_time

Lib/_strptime.py:818–828  ·  view source on GitHub ↗

Return a time instance based on the input string and the format string.

(cls, data_string, format="%H:%M:%S")

Source from the content-addressed store, hash-verified

816 return datetime_timezone(tzdelta)
817
818def _strptime_datetime_time(cls, data_string, format="%H:%M:%S"):
819 """Return a time instance based on the input string and the
820 format string."""
821 tt, fraction, gmtoff_fraction = _strptime(data_string, format)
822 tzname, gmtoff = tt[-2:]
823 args = tt[3:6] + (fraction,)
824 if gmtoff is None:
825 return cls(*args)
826 else:
827 tz = _parse_tz(tzname, gmtoff, gmtoff_fraction)
828 return cls(*args, tz)
829
830def _strptime_datetime_datetime(cls, data_string, format="%a %b %d %H:%M:%S %Y"):
831 """Return a datetime instance based on the input string and the

Callers

nothing calls this directly

Calls 3

_strptimeFunction · 0.85
_parse_tzFunction · 0.85
clsClass · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…