ct打印的是时间戳,时间戳的小数点后前三位为ms  eg:1555644362.055328   ms = 055

import time

ct = time.time()
local_time = time.localtime(ct)
data_head = time.strftime("%Y-%m-%d %H:%M:%S", local_time)
data_secs = (ct - int(ct))  * 1000
time_stamp = "%s.%03d" % (data_head, data_secs)
print(ct)
print(local_time)
print(data_head)
print(time_stamp)

 

相关文章:

  • 2021-10-31
  • 2022-01-23
  • 2021-09-16
  • 2022-12-23
  • 2021-12-21
  • 2021-07-03
  • 2022-12-23
猜你喜欢
  • 2022-02-15
  • 2021-07-04
  • 2021-06-08
  • 2021-12-07
  • 2022-02-25
  • 2021-09-29
相关资源
相似解决方案