MCPcopy
hub / github.com/django/django / http_date

Function http_date

django/utils/http.py:86–97  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

84
85
86def 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
100def parse_http_date(date):

Callers 12

process_responseMethod · 0.90
indexFunction · 0.90
sitemapFunction · 0.90
__call__Method · 0.90
patch_response_headersFunction · 0.90
set_cookieMethod · 0.90
serveFunction · 0.90
_post_process_requestFunction · 0.90
test_http_dateMethod · 0.90

Calls

no outgoing calls

Tested by 4

test_http_dateMethod · 0.72