python日期获取今明后天

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import pandas as pd
import openpyxl
from pathlib import Path

import datedays

if __name__ == '__main__':
    print("现在时间:", datedays.getnow()) 		 # format_=格式,比如:%Y-%m-%d %H:%M:%S
    print('-' * 30)
    print("明天:", datedays.gettomorrow())
    print("后天:", datedays.gettomorrow(days=2))  # days等于多少,就是多少天
    print("30天后是几号:", datedays.gettomorrow(days=30))
    print("180天后是几月几号:", datedays.gettomorrow(days=180))
    print("1000天后是几月几号:", datedays.gettomorrow(days=1000))
    print('-' * 30)
    print("昨天:", datedays.getyesterday())
    print("前天:", datedays.getyesterday(days=2))
    print("180天前:", datedays.getyesterday(days=180))
    print("1000天前是几月几号:", datedays.getyesterday(days=1000))

你可能感兴趣的:(python系列,python,开发语言,numpy)