MCPcopy Index your code
hub / github.com/fluentpython/example-code-2e / http_date

Function http_date

21-async/mojifinder/bottle.py:2541–2548  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

2539 DEBUG = bool(mode)
2540
2541def http_date(value):
2542 if isinstance(value, (datedate, datetime)):
2543 value = value.utctimetuple()
2544 elif isinstance(value, (int, float)):
2545 value = time.gmtime(value)
2546 if not isinstance(value, basestring):
2547 value = time.strftime("%a, %d %b %Y %H:%M:%S GMT", value)
2548 return value
2549
2550def parse_date(ims):
2551 """ Parse rfc1123, rfc850 and asctime timestamps and return UTC epoch. """

Callers 1

BaseResponseClass · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected