title: Convert Python datetime to rfc 2822
body: <p>I want to convert a Python datetime to an RFC 2822 datetime.  I've tried these methods to no avail:</p>
  
  <pre><code>&gt;&gt;&gt; from email.Utils import formatdate
  &gt;&gt;&gt; import datetime
  &gt;&gt;&gt; formatdate(datetime.datetime.now())
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/email    /utils.py", line 159, in formatdate
      now = time.gmtime(timeval)
  TypeError: a float is required
  </code></pre>