MCPcopy Create free account
hub / github.com/datapane/datapane / parse_date

Function parse_date

python-client/src/datapane/_vendor/bottle.py:2966–2972  ·  view source on GitHub ↗

Parse rfc1123, rfc850 and asctime timestamps and return UTC epoch.

(ims)

Source from the content-addressed store, hash-verified

2964
2965
2966def parse_date(ims):
2967 """ Parse rfc1123, rfc850 and asctime timestamps and return UTC epoch. """
2968 try:
2969 ts = email.utils.parsedate_tz(ims)
2970 return calendar.timegm(ts[:8] + (0, )) - (ts[9] or 0)
2971 except (TypeError, ValueError, IndexError, OverflowError):
2972 return None
2973
2974
2975def parse_auth(header):

Callers 2

BaseResponseClass · 0.85
static_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected