diff options
author | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2011-01-19 19:53:30 (GMT) |
---|---|---|
committer | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2011-01-19 19:53:30 (GMT) |
commit | 41a99bc20d378c9bb624a14b0d993be30c7b210d (patch) | |
tree | e59c7611156706eea86bd7f691c577bca8f82ccb /Doc/library/imaplib.rst | |
parent | e47e093f7009ca758f044c52178071b68e48bf2a (diff) | |
download | cpython-41a99bc20d378c9bb624a14b0d993be30c7b210d.zip cpython-41a99bc20d378c9bb624a14b0d993be30c7b210d.tar.gz cpython-41a99bc20d378c9bb624a14b0d993be30c7b210d.tar.bz2 |
Issue #10934: Fixed and expanded Internaldate2tuple() and
Time2Internaldate() documentation. Thanks Joe Peterson for the report
and the original patch.
Diffstat (limited to 'Doc/library/imaplib.rst')
-rw-r--r-- | Doc/library/imaplib.rst | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Doc/library/imaplib.rst b/Doc/library/imaplib.rst index dc94beb..632baa3 100644 --- a/Doc/library/imaplib.rst +++ b/Doc/library/imaplib.rst @@ -85,9 +85,9 @@ The following utility functions are defined: .. function:: Internaldate2tuple(datestr) - Converts an IMAP4 INTERNALDATE string to Coordinated Universal Time. Returns a - :mod:`time` module tuple. - + Parse an IMAP4 ``INTERNALDATE`` string and return corresponding local + time. The return value is a :class:`time.struct_time` tuple or + None if the string has wrong format. .. function:: Int2AP(num) @@ -102,9 +102,13 @@ The following utility functions are defined: .. function:: Time2Internaldate(date_time) - Converts a :mod:`time` module tuple to an IMAP4 ``INTERNALDATE`` representation. - Returns a string in the form: ``"DD-Mmm-YYYY HH:MM:SS +HHMM"`` (including - double-quotes). + Convert *date_time* to an IMAP4 ``INTERNALDATE`` representation. The + return value is a string in the form: ``"DD-Mmm-YYYY HH:MM:SS + +HHMM"`` (including double-quotes). The *date_time* argument can be a + number (int or float) represening seconds since epoch (as returned + by :func:`time.time`), a 9-tuple representing local time (as returned by + :func:`time.localtime`), or a double-quoted string. In the last case, it + is assumed to already be in the correct format. Note that IMAP4 message numbers change as the mailbox changes; in particular, after an ``EXPUNGE`` command performs deletions the remaining messages are |