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