rfc2822

Convert Python datetime to rfc 2822

Convert Python datetime to rfc 2822 Question: I want to convert a Python datetime to an RFC 2822 datetime. I’ve tried these methods to no avail: >>> from email.Utils import formatdate >>> import datetime >>> formatdate(datetime.datetime.now()) Traceback (most recent call last): File “<stdin>”, line 1, in <module> File “/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/email /utils.py”, line 159, in formatdate now …

Total answers: 5