擅长:python、mysql、java
<p>另一种方法是使用<a href="http://docs.python.org/3.3/library/calendar.html#calendar.timegm" rel="noreferrer">^{<cd1>}</a>:</p>
<pre><code>future = datetime.datetime.utcnow() + datetime.timedelta(minutes=5)
return calendar.timegm(future.timetuple())
</code></pre>
<p>它也比<code>%s</code>标记到<code>strftime</code>(在Windows上不工作)更便于移植。</p>