- 把文本形式的時(shí)間格式轉(zhuǎn)換成時(shí)間戳格式,以便用于時(shí)間的對(duì)比
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