a guest Jun 15th, 2019 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- from datetime import datetime
- from datetime import timedelta
- today = '2019-04-05'
- today_number = datetime.strptime(today, '%Y-%m-%d')
- before_2days = today_number - timedelta(days=2)
- after_2days = today_number + timedelta(days=2)
- with open('input/days.txt', encoding='utf-8') as f:
- for n in f:
- day = datetime.strptime(n.rstrip(),"%Y-%m-%d")
- if before_2days <= day <= after_2days:
RAW Paste Data