def change_time(times,status):
if status==1:
time_stamp_arrary=time.localtime(times)
date_time=time.strftime("%Y-%m-%d",time_stamp_arrary)
return date_time
elif status==0:
time_array=time.strptime(times,"%Y-%m-%d")
time_stamp=int(time.mktime(time_array))
return time_stamp
本文出自 “新掌门” 博客,请务必保留此出处http://linuxnewstar.blog.51cto.com/6967359/1768491
原文地址:http://linuxnewstar.blog.51cto.com/6967359/1768491