擅长:python、mysql、java
<p>您可以使用<a href="http://docs.python.org/library/datetime.html#datetime.datetime.utctimetuple" rel="noreferrer">^{<cd2>}</a>在UTC中创建<code>struct_time</code>,然后使用<a href="http://docs.python.org/library/calendar.html#calendar.timegm" rel="noreferrer">^{<cd3>}</a>将其转换为unix时间戳:</p>
<pre><code>calendar.timegm(parseddate.utctimetuple())
</code></pre>
<p>这也会考虑任何夏时制时间偏移,因为<code>utctimetuple()</code>会使其正常化。</p>