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

Function parsedate_to_datetime

Lib/email/utils.py:315–323  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

313
314
315def parsedate_to_datetime(data):
316 parsed_date_tz = _parsedate_tz(data)
317 if parsed_date_tz is None:
318 raise ValueError('Invalid date value or format "%s"' % str(data))
319 *dtuple, tz = parsed_date_tz
320 if tz is None:
321 return datetime.datetime(*dtuple[:6])
322 return datetime.datetime(*dtuple[:6],
323 tzinfo=datetime.timezone(datetime.timedelta(seconds=tz)))
324
325
326def parseaddr(addr, *, strict=True):

Callers

nothing calls this directly

Calls 3

_parsedate_tzFunction · 0.90
strFunction · 0.85
datetimeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…