python 時間戳轉化

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
相關文章
相關標籤/搜索