Format the time to match the RFC 5322 date format as specified by RFC 9110 Section 5.6.7. `epoch_seconds` is a floating point number expressed in seconds since the epoch, in UTC - such as that outputted by time.time(). If set to None, it defaults to the current time. Outpu
(epoch_seconds=None)
| 84 | |
| 85 | |
| 86 | def http_date(epoch_seconds=None): |
| 87 | """ |
| 88 | Format the time to match the RFC 5322 date format as specified by RFC 9110 |
| 89 | Section 5.6.7. |
| 90 | |
| 91 | `epoch_seconds` is a floating point number expressed in seconds since the |
| 92 | epoch, in UTC - such as that outputted by time.time(). If set to None, it |
| 93 | defaults to the current time. |
| 94 | |
| 95 | Output a string in the format 'Wdy, DD Mon YYYY HH:MM:SS GMT'. |
| 96 | """ |
| 97 | return formatdate(epoch_seconds, usegmt=True) |
| 98 | |
| 99 | |
| 100 | def parse_http_date(date): |
no outgoing calls