test.py 181 B

123456
  1. import time,datetime
  2. import dateutil.relativedelta
  3. now_time = datetime.datetime.now()
  4. pre_time = now_time + dateutil.relativedelta.relativedelta(weeks=-2)
  5. print(now_time, pre_time)