mirror of
https://github.com/python/cpython.git
synced 2025-11-02 19:12:55 +00:00
formatdate(): A better docstring.
This commit is contained in:
parent
3988574075
commit
9cff0e604a
1 changed files with 7 additions and 4 deletions
|
|
@ -106,13 +106,16 @@ def encode(s, charset='iso-8859-1', encoding='q'):
|
||||||
|
|
||||||
|
|
||||||
def formatdate(timeval=None, localtime=0):
|
def formatdate(timeval=None, localtime=0):
|
||||||
"""Returns a formatted time as specified by RFC 2822, e.g.:
|
"""Returns a date string as specified by RFC 2822, e.g.:
|
||||||
|
|
||||||
Fri, 09 Nov 2001 01:08:47 -0000
|
Fri, 09 Nov 2001 01:08:47 -0000
|
||||||
|
|
||||||
Optional timeval if given is a float time as accepted by localtime() or
|
Optional timeval if given is a floating point time value as accepted by
|
||||||
gmtime(). Optional localtime is a flag that when true, interprets and
|
gmtime() and localtime(), otherwise the current time is used.
|
||||||
returns a time relative to the local timezone instead of UTC.
|
|
||||||
|
Optional localtime is a flag that when true, interprets timeval, and
|
||||||
|
returns a date relative to the local timezone instead of UTC, properly
|
||||||
|
taking daylight savings time into account.
|
||||||
"""
|
"""
|
||||||
# Note: we cannot use strftime() because that honors the locale and RFC
|
# Note: we cannot use strftime() because that honors the locale and RFC
|
||||||
# 2822 requires that day and month names be the English abbreviations.
|
# 2822 requires that day and month names be the English abbreviations.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue