# 将时间变成时间戳 def tranftimestamp(stringtime): try: return time.mktime(time.strptime(stringtime, "%Y-%m-%d %H:%M:%S.%f")) except: return time.mktime(time.strptime(stringtime, "%Y-%m-%d %H:%M:%S")) # 将时间戳转化为时间 d
def tranftimestamp(stringtime):
try:
return time.mktime(time.strptime(stringtime, "%Y-%m-%d %H:%M:%S.%f"))
except:
return time.mktime(time.strptime(stringtime, "%Y-%m-%d %H:%M:%S"))
# 将时间戳转化为时间
def tranftime(timestamp):
return time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(timestamp)) 【本文转自:海外高防服务器 http://www.558idc.com/krgf.html 欢迎留下您的宝贵建议】