summaryrefslogtreecommitdiffstats
path: root/Lib/email
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2001-11-09 17:07:28 (GMT)
committerBarry Warsaw <barry@python.org>2001-11-09 17:07:28 (GMT)
commit9cff0e604a5fe522b615fbd906ffc615eda50d72 (patch)
tree8d882b47dbd5135d1a72d8ab287e5ef2a0411ca6 /Lib/email
parent39885740754f73ed3b120a5917433f022559ba2a (diff)
downloadcpython-9cff0e604a5fe522b615fbd906ffc615eda50d72.zip
cpython-9cff0e604a5fe522b615fbd906ffc615eda50d72.tar.gz
cpython-9cff0e604a5fe522b615fbd906ffc615eda50d72.tar.bz2
formatdate(): A better docstring.
Diffstat (limited to 'Lib/email')
-rw-r--r--Lib/email/Utils.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/Lib/email/Utils.py b/Lib/email/Utils.py
index 237b686..93e0a83 100644
--- a/Lib/email/Utils.py
+++ b/Lib/email/Utils.py
@@ -106,13 +106,16 @@ def encode(s, charset='iso-8859-1', encoding='q'):
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
- Optional timeval if given is a float time as accepted by localtime() or
- gmtime(). Optional localtime is a flag that when true, interprets and
- returns a time relative to the local timezone instead of UTC.
+ Optional timeval if given is a floating point time value as accepted by
+ gmtime() and localtime(), otherwise the current time is used.
+
+ 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
# 2822 requires that day and month names be the English abbreviations.