File: example.py

package info (click to toggle)
python-dateutil 2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 964 kB
  • ctags: 1,380
  • sloc: python: 6,537; makefile: 23; sh: 4
file content (15 lines) | stat: -rw-r--r-- 549 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from dateutil.relativedelta import *
from dateutil.easter import *
from dateutil.rrule import *
from dateutil.parser import *
from datetime import *
import subprocess
import os
now = parse(subprocess.getoutput("LC_ALL=C date"))
today = now.date()
year = rrule(YEARLY, bymonth=8, bymonthday=13, byweekday=FR)[0].year
rdelta = relativedelta(easter(year), today)
print("Today is:", today)
print("Year with next Aug 13th on a Friday is:", year)
print("How far is the Easter of that year:", rdelta)
print("And the Easter of that year is:", today+rdelta)