- 把文本形式的时间格式转换成时间戳格式,以便用于时间的对比
import time
def time_transform(times):
ts = time.mktime(time.strptime('{}'.format(times), "%Y-%m-%d : %H:%M:%S"))
return ts
import time
def time_transform(times):
ts = time.mktime(time.strptime('{}'.format(times), "%Y-%m-%d : %H:%M:%S"))
return ts