時間相減範例程式

start_dt = datetime.datetime.strptime(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()), '%Y-%m-%d %H:%M:%S')

end_dt = datetime.datetime.strptime(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()), '%Y-%m-%d %H:%M:%S')

diff = (end_dt - start_dt)

print(diff)

image

arrow
arrow
    文章標籤
    時間相減
    全站熱搜

    JL8051 發表在 痞客邦 留言(0) 人氣()