Python time()函數返回的是1970-1-1 00:00:00 到如今的秒數

python 中time.time()獲取到的是從1970-1-1 00:00:00 到如今的秒數(小數位還有6位)。python 須要獲取毫秒數的時候:int(time.time()*1000),在一些有實效性要求的請求中可能須要這個與時間戳做用同樣的毫秒數來標識一個精確的時間點。 僅獲取毫秒,則可使用int(time.time()*1000)-int(time.time())*1000
相關文章
相關標籤/搜索