python-计算俩日期相差多少天

from datetime import datetime

if __name__ == '__main__':
    cur_day = datetime(2019, 7, 30)
    next_day = datetime(2019, 7, 31)
    print((next_day - cur_day).days)  # 1
    print("ok")

你可能感兴趣的:(Python)