MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / parsedate_to_datetime

Function parsedate_to_datetime

tools/python-3.11.9-amd64/Lib/email/utils.py:197–205  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

195
196
197def parsedate_to_datetime(data):
198 parsed_date_tz = _parsedate_tz(data)
199 if parsed_date_tz is None:
200 raise ValueError('Invalid date value or format "%s"' % str(data))
201 *dtuple, tz = parsed_date_tz
202 if tz is None:
203 return datetime.datetime(*dtuple[:6])
204 return datetime.datetime(*dtuple[:6],
205 tzinfo=datetime.timezone(datetime.timedelta(seconds=tz)))
206
207
208def parseaddr(addr):

Callers

nothing calls this directly

Calls 3

_parsedate_tzFunction · 0.90
strFunction · 0.85
datetimeMethod · 0.80

Tested by

no test coverage detected