blob: ffa78e7c31dfdb4aba9b0154c5c476a49fb76df0 [file] [log] [blame]
niemeyerdebf3cd2005-02-23 18:33:30 +00001from dateutil.relativedelta import *
2from dateutil.easter import *
3from dateutil.rrule import *
4from dateutil.parser import *
5from datetime import *
Gustavo Niemeyerac37a802011-03-24 14:16:39 -03006import subprocess
niemeyerdebf3cd2005-02-23 18:33:30 +00007import os
Gustavo Niemeyerac37a802011-03-24 14:16:39 -03008now = parse(subprocess.getoutput("date"))
niemeyerdebf3cd2005-02-23 18:33:30 +00009today = now.date()
Gustavo Niemeyerac37a802011-03-24 14:16:39 -030010year = rrule(YEARLY, bymonth=8, bymonthday=13, byweekday=FR)[0].year
niemeyerdebf3cd2005-02-23 18:33:30 +000011rdelta = relativedelta(easter(year), today)
Gustavo Niemeyerac37a802011-03-24 14:16:39 -030012print("Today is:", today)
13print("Year with next Aug 13th on a Friday is:", year)
14print("How far is the Easter of that year:", rdelta)
15print("And the Easter of that year is:", today+rdelta)