import time
from datetime import *
datetime_str = "20191201102413310"
datetime_obj = datetime.strptime(datetime_str , "%Y%m%d%H%M%S%f") # 格式化为datetime类型
timestamp = int(time.mktime(datetime_obj.timetuple()) * 1000.0 + datetime_obj.microsecond / 1000.0)