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

Function _date_from_string

Lib/plistlib.py:140–151  ·  view source on GitHub ↗
(s, aware_datetime)

Source from the content-addressed store, hash-verified

138
139
140def _date_from_string(s, aware_datetime):
141 order = ('year', 'month', 'day', 'hour', 'minute', 'second')
142 gd = _dateParser.match(s).groupdict()
143 lst = []
144 for key in order:
145 val = gd[key]
146 if val is None:
147 break
148 lst.append(int(val))
149 if aware_datetime:
150 return datetime.datetime(*lst, tzinfo=datetime.UTC)
151 return datetime.datetime(*lst)
152
153
154def _date_to_string(d, aware_datetime):

Callers 1

end_dateMethod · 0.85

Calls 3

datetimeMethod · 0.80
matchMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…