擅长:python、mysql、java
<p>Python 3.3除了其他注释者提到的方法之外,还添加了一个更干净的<code>format_datetime</code>方法:</p>
<pre><code>>>> import datetime
>>> import email.utils
>>> dt = datetime.datetime.now()
>>> email.utils.format_datetime(dt)
'Thu, 09 Mar 2017 10:50:00 -0000'
</code></pre>