import datetime import random import time import pyautogui now_time = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()) print(f'打印今天的日期时间:{now_time}') now_time = time.strftime('%Y-%m-%d', time.localtime()) print(f'打印今天的日期:{now_time}') today = datetime.date.today() print(f'打印今天的日期:{now_time}') today = datetime.date.today() yesterday = today - datetime.timedelta(days=1) print(f'打印昨天的日期:{yesterday}') today = datetime.date.today() tomorrow = today + datetime.timedelta(days=1) print(f'打印明天的日期:{tomorrow}') today = datetime.date.today() mb_day = today - datetime.timedelta(days=60) print(f'打印从今天往前算两个月的时间:{mb_day}')
站长微信:xiaomao0055
站长QQ:14496453