1
from time import time
time() # Gives me 1298046251.375916
我需要01/01/2011 01:48:36.157
转换为同样的时间戳和我比较熟悉Python的日期/时间库。什么是最简单的方法来完成这一点?是否有相当于strtotime
的功能?在Python转换时间戳UNIX时间戳
考虑到MongoDB wants a datetime
object它也会被接受而不是unix风格的时间戳。
I *只是*发现坐在`datetime`页及成品的底部制定出公式。谢谢! – 2011-02-18 16:32:08