python 时间戳转换
2018-10-15 本文已影响0人
一束荆棘
startTime='2017-07-07 12:00:00'
starttimeArray= time.strptime(startTime, "%Y-%m-%d %H:%M:%S")
startTimeStamp = int(time.mktime(starttimeArray))
print startTimeStamp #时间戳
startTime='2017-07-07 12:00:00'
starttimeArray= time.strptime(startTime, "%Y-%m-%d %H:%M:%S")
startTimeStamp = int(time.mktime(starttimeArray))
print startTimeStamp #时间戳