擅长:python、mysql、java
<p>我必须使用<a href="http://pytz.sourceforge.net/" rel="nofollow noreferrer">pytz</a></p>
<pre><code>from datetime import *
from pytz import timezone
import pytz
[...]
if (not isinstance(pacificTime, int)):
pacificTime = int(pacificTime)
originalTimeZone = "America/Los_Angeles"
print datetime.fromtimestamp(pacificTime, pytz.timezone(originalTimeZone))
</code></pre>
<p>这个解决方案来自我以前的帖子:<a href="https://stackoverflow.com/questions/6706808/changing-a-unix-timestamp-to-a-different-timezone/6707507#6707507">Changing a unix timestamp to a different timezone</a></p>
<p>希望能有所帮助</p>