Python利用datetime計算時間差

Python使用datetime模塊生成計算時間差函數python import datetime def difftime(off_bt, on_bt): #輸入的日期和時間是字符串形式,須要先將字符串格式化爲datetime形式。 time1 = datetime.datetime.strptime(off_bt, "%Y-%m-%d %H:%M:%S") time
相關文章
相關標籤/搜索