Parse rfc1123, rfc850 and asctime timestamps and return UTC epoch.
(ims)
| 2548 | return value |
| 2549 | |
| 2550 | def parse_date(ims): |
| 2551 | """ Parse rfc1123, rfc850 and asctime timestamps and return UTC epoch. """ |
| 2552 | try: |
| 2553 | ts = email.utils.parsedate_tz(ims) |
| 2554 | return time.mktime(ts[:8] + (0,)) - (ts[9] or 0) - time.timezone |
| 2555 | except (TypeError, ValueError, IndexError, OverflowError): |
| 2556 | return None |
| 2557 | |
| 2558 | def parse_auth(header): |
| 2559 | """ Parse rfc2617 HTTP authentication header string (basic) and return (user,pass) tuple or None""" |
no outgoing calls
no test coverage detected