You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
imaplib: Internaldate2tuple() is documented to return UTC, but it returns local time #55143
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2011-01-19.21:48:54.412>created_at=<Date2011-01-18.13:46:04.849>labels= ['docs']
title='imaplib: Internaldate2tuple() is documented to return UTC, but it returns local time'updated_at=<Date2011-01-19.21:48:54.410>user='https://bugs.python.org/lavajoe'
It makes sense that Internaldate2tuple() returns local time because timetuple (with its tm_isdst flag) strongly suggests local time. (See also bpo-9004.)
If UTC or any other timezone time is needed, it would be best to provide a function that would return an aware datetime object.
I made some changes to Joe's patch in attached diff. I would appreciate another pair of eyes to look at it before I commit.
lavajoe commented on Jan 19, 2011
lavajoemannequin
MannequinAuthor
More actions
Hey Alexander,
Looks great. Just a few small things:
In hunk 2 of the imaplib.rst file patch section, insert word "to" (i.e. "Convert date_time to an IMAP4 INTERNALDATE representation.")
Two lines, down there's only one space at end of sentence: "double-quotes). The" (all other places have 2 spaces).
In first hunk of imaplib.py patch section, there is a period that does not belong after "tuple": "time.struct_time tuple. or None"
That's all I saw! Thanks for expanding on the doc!
Activity
lavajoe commentedon Jan 18, 2011
Patched documentation for Internaldate2tuple() to correctly state it returns local time.
Also, Time2Internaldate() (its inverse) did not state that it needs local time as input, so patched this as well.
Patches for 3.2 and 2.7 are attached.
abalkin commentedon Jan 19, 2011
It makes sense that Internaldate2tuple() returns local time because timetuple (with its tm_isdst flag) strongly suggests local time. (See also bpo-9004.)
If UTC or any other timezone time is needed, it would be best to provide a function that would return an aware datetime object.
I made some changes to Joe's patch in attached diff. I would appreciate another pair of eyes to look at it before I commit.
lavajoe commentedon Jan 19, 2011
Hey Alexander,
Looks great. Just a few small things:
In hunk 2 of the imaplib.rst file patch section, insert word "to" (i.e. "Convert date_time to an IMAP4
INTERNALDATErepresentation.")Two lines, down there's only one space at end of sentence: "double-quotes). The" (all other places have 2 spaces).
In first hunk of imaplib.py patch section, there is a period that does not belong after "tuple": "time.struct_time tuple. or None"
That's all I saw! Thanks for expanding on the doc!
abalkin commentedon Jan 19, 2011
Committed in revision 88114.
abalkin commentedon Jan 19, 2011
Merged to 2.7 in revision 88116.
pythongh-55143: Add a streaming C implementation of the JSON encoder