MCPcopy Index your code
hub / github.com/python/cpython / date_time_string

Method date_time_string

Lib/http/server.py:637–641  ·  view source on GitHub ↗

Return the current date and time formatted for a message header.

(self, timestamp=None)

Source from the content-addressed store, hash-verified

635 return self.server_version + ' ' + self.sys_version
636
637 def date_time_string(self, timestamp=None):
638 """Return the current date and time formatted for a message header."""
639 if timestamp is None:
640 timestamp = time.time()
641 return email.utils.formatdate(timestamp, usegmt=True)
642
643 def log_date_time_string(self):
644 """Return the current time formatted for logging."""

Callers 3

send_responseMethod · 0.95
send_headMethod · 0.80
test_date_time_stringMethod · 0.80

Calls 1

timeMethod · 0.45

Tested by 1

test_date_time_stringMethod · 0.64