<p>Is there a fairly easy way to convert a datetime object into an RFC 1123 (HTTP/1.1) date/time string, i.e. a string with the format</p>

<pre><code>Sun, 06 Nov 1994 08:49:37 GMT
</code></pre>

<p>Using <code>strftime</code> does not work, since the strings are locale-dependant. Do I have to build the string by hand?</p>

You can set LC_TIME to force stftime() to use a specific locale:
```
```
>>> locale.setlocale(locale.LC_TIME, 'en_US')
'en_US'
>>> datetime.datetime.now().strftime(locale.nl_langinfo(locale.D_T_FMT))
'Wed 22 Oct 2008 06:05:39 AM '
```
```