def strTurnTimestamp(string_times):
# 字符串转成时间戳
order_time = string_times.strftime("%Y-%m-%d %H:%M:%S")
timeArray = time.strptime(order_time, "%Y-%m-%d %H:%M:%S")
# 秒的时间戳
timestamp=int(time.mktime(timeArray))
# 毫秒时间戳
ms_time = int(round(timestamp * 1000))
return ms_time
传入参数在数据库中的类型是datetime