我想将字符串日期格式转换为微秒的时间戳我尝试以下但不给出预期的结果:
"""input string date -> 2014-08-01 04:41:52,117
expected result -> 1410748201.117"""
import time
import datetime
myDate = "2014-08-01 04:41:52,117"
timestamp = time.mktime(datetime.datetime.strptime(myDate, "%Y-%m-%d %H:%M:%S,%f").timetuple())
print timestamp
> 1410748201.0
Run Code Online (Sandbox Code Playgroud)
毫秒在哪里?