<p>我试图使用strftime()达到微秒精度,这似乎可以使用%f(如前所述<a href="http://docs.python.org/library/datetime.html#strftime-strptime-behavior" rel="noreferrer">here</a>)。但是,当我尝试以下代码时:</p>
<pre><code>import time
import strftime from time
print strftime("%H:%M:%S.%f")
</code></pre>
<p>…我得到小时、分钟和秒,但是%f打印为%f,没有微秒的迹象。我在Ubuntu上运行Python 2.6.5,所以应该没问题,应该支持%f(据我所知,它支持2.6及更高版本)</p>