Parse rfc1123, rfc850 and asctime timestamps and return UTC epoch.
(ims)
| 3362 | |
| 3363 | |
| 3364 | def parse_date(ims): |
| 3365 | """ Parse rfc1123, rfc850 and asctime timestamps and return UTC epoch. """ |
| 3366 | try: |
| 3367 | ts = email.utils.parsedate_tz(ims) |
| 3368 | return calendar.timegm(ts[:8] + (0, )) - (ts[9] or 0) |
| 3369 | except (TypeError, ValueError, IndexError, OverflowError): |
| 3370 | return None |
| 3371 | |
| 3372 | |
| 3373 | def parse_auth(header): |
no outgoing calls
no test coverage detected
searching dependent graphs…