<div dir="ltr">Something like this?<div><br></div><div>class GMT(tzinfo):</div><div>    def tzname(self, dt):</div><div>        return "GMT"</div><div><br></div><div>    def utcoffset(self, dt):</div><div>        return timedelta(0)</div><div>        </div><div>    def dst(self, dt):</div><div>        return timedelta(0)</div><div><br></div><div>datetime(1994, 11, 6, 8, 49, 37, 0, GMT()).strftime('%a, %d %b %Y %H:%M:%S %Z')</div><div><pre style="overflow:auto;font-size:14px;padding:0px;margin-top:0px;margin-bottom:0px;line-height:17.0001px;word-break:break-all;word-wrap:break-word;color:rgb(0,0,0);border:0px;border-radius:0px;white-space:pre-wrap;vertical-align:baseline">'Sun, 06 Nov 1994 08:49:37 GMT'</pre></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Feb 17, 2016 at 12:52 PM Fahrzin Hemmati via Baypiggies <<a href="mailto:baypiggies@python.org">baypiggies@python.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><a href="https://docs.python.org/2/library/email.util.html#email.utils.formatdate" target="_blank">https://docs.python.org/2/library/email.util.html#email.utils.formatdate</a><br><div>Set usegmt=True to get the right timezone string.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 17, 2016 at 11:44 AM, Ian Zimmerman <span dir="ltr"><<a href="mailto:itz@buug.org" target="_blank">itz@buug.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Is there a _simple_ way of formatting a date/time (in any of the<br>
representations native to the Python standard library) in the format<br>
specified by RFC 7231 [1]?<br>
<br>
I do not consider an implementation simple if it contains its own lists<br>
of day and month names, such as [2] does.<br>
<br>
At some point, I will have to parse the format as well.<br>
<br>
[1]<br>
<a href="https://tools.ietf.org/html/rfc7231#section-7.1.1.1" rel="noreferrer" target="_blank">https://tools.ietf.org/html/rfc7231#section-7.1.1.1</a><br>
<br>
[2]<br>
<a href="https://github.com/sam-washington/requests-aws4auth/blob/master/requests_aws4auth/aws4auth.py#L396" rel="noreferrer" target="_blank">https://github.com/sam-washington/requests-aws4auth/blob/master/requests_aws4auth/aws4auth.py#L396</a><br>
<span><font color="#888888"><br>
--<br>
Please *no* private copies of mailing list or newsgroup messages.<br>
Rule 420: All persons more than eight miles high to leave the court.<br>
_______________________________________________<br>
Baypiggies mailing list<br>
<a href="mailto:Baypiggies@python.org" target="_blank">Baypiggies@python.org</a><br>
To change your subscription options or unsubscribe:<br>
<a href="https://mail.python.org/mailman/listinfo/baypiggies" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/baypiggies</a><br>
</font></span></blockquote></div><br></div>
_______________________________________________<br>
Baypiggies mailing list<br>
<a href="mailto:Baypiggies@python.org" target="_blank">Baypiggies@python.org</a><br>
To change your subscription options or unsubscribe:<br>
<a href="https://mail.python.org/mailman/listinfo/baypiggies" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/baypiggies</a></blockquote></div>