R. David Murray <rdmur...@bitdance.com> added the comment: OK, here is a new patch proposal. As suggested by Alexander, it adds two functions to email.utils: format_datetime and parsedate_to_datetime. Adding these does not require having localtime. In fact, with this patch you can get an aware datetime representing email's current best guess at localtime by doing:
dt = parsedate_to_datetime(formatdate(localtime=True)) Reviews welcome, but this is simple enough I'll probably just commit it if no one objects. ---------- assignee: belopolsky -> r.david.murray Added file: http://bugs.python.org/file22649/util_datetime.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue665194> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com