import time
timestr = "2019-07-26 11:05:33"timestamp = int(time.mktime(time.strptime(timestr,"%Y-%m-%d %H:%M:%S")))
输出:1564110333